Cruisers Forum
 


Join CruisersForum Today

Reply
 
Thread Tools Rate Thread Display Modes
Old 01-09-2014, 06:18   #1
Registered User

Join Date: Sep 2014
Posts: 7
Map API - WMS Support?

Good day all,

As an developer I've taken an interest in the OpenCPN software. I currently live in Norway, and it appears that the only way to get good charts for my area is either through illegal methods, or scanning/adjusting paper maps.

However, official (raster) maps is publicly available through a web service (WMS). Im poking around with the idea of making a plugin that would fetch the correct maps and present it in OpenCPN in one operation. This would ofcourse require a network condition, but could later be extended with offline cache/storage.

This would be a fun weekend/side project for me and primarily driven from curioisity rather then expectations of a "production ready results", it would be open source and open for contributions though if anyone would want to participate/extend the funtionalty.

I do have a few years of programming experience, however its (no longer) my day job.

Before I start digging into details, could I get some feedback from the experienced community weither this is at all feasable/possible?
__________________

__________________
moyd is offline   Reply With Quote
Old 01-09-2014, 06:34   #2
bcn
Registered User

Join Date: May 2011
Location: underway whenever possible
Boat: Rangeboat 39
Posts: 2,760
Re: Map API - WMS Support?

Moyd,

that would be interesting for sure - especially if it would cover all the architectures OpenCPN is working on (Win, Lin, Mac).
WMS would open a wide range of opportunities not just in Norway.

You might have a look here:
Online creation of BSB/KAP files from Google Maps
This seems to go in the direction you want to take. Why not join forces?

OpenCPN will ingest geo referenced raster charts in the BSBv3 (.kap) format.
There are utilities in place, just search the forum.

And btw.: for Norway there are also official, non free vector charts in the S63 available. --> S63 plug-in. There are some users in Norway already.

Hubert
__________________

__________________
bcn is online now   Reply With Quote
Old 01-09-2014, 07:28   #3
Registered User

Join Date: Sep 2014
Posts: 7
Re: Map API - WMS Support?

Quote:
Originally Posted by bcn View Post
Moyd,

that would be interesting for sure - especially if it would cover all the architectures OpenCPN is working on (Win, Lin, Mac).
WMS would open a wide range of opportunities not just in Norway.
I use OSX, Linux and Windows on different machines every day, so multi platform would be natural

Quote:
Originally Posted by bcn View Post
You might have a look here:
Online creation of BSB/KAP files from Google Maps
This seems to go in the direction you want to take. Why not join forces?
Same direction, slightly different approach - But thanks for the link, my searches did not find that one. I'll definatly look into that.

Quote:
Originally Posted by bcn View Post
OpenCPN will ingest geo referenced raster charts in the BSBv3 (.kap) format.
There are utilities in place, just search the forum.
Yes - but can you load then through the plugin API? - Or do you have to save, then reference through the charts setup?

Quote:
Originally Posted by bcn View Post
And btw.: for Norway there are also official, non free vector charts in the S63 available. --> S63 plug-in. There are some users in Norway already.

Hubert
You are right, I've seen that before, but utilizing the free raster charts seems more of a challenge and more fun. (And the quality seems nice too - not sure there are that many benefits to the s63 charts)
__________________
moyd is offline   Reply With Quote
Old 01-09-2014, 07:34   #4
bcn
Registered User

Join Date: May 2011
Location: underway whenever possible
Boat: Rangeboat 39
Posts: 2,760
Re: Map API - WMS Support?

Quote:
Originally Posted by moyd View Post

Yes - but can you load then through the plugin API? - Or do you have to save, then reference through the charts setup?
Those processes are thought as batches running independently from OpenCPN. One throws the resulting charts in a directory, pointing OpenCPN to it.
So not integrated solutions or plug-ins.
__________________
bcn is online now   Reply With Quote
Old 01-09-2014, 07:50   #5
Registered User

Join Date: Sep 2014
Posts: 7
Re: Map API - WMS Support?

Thanks, I guess thats a sensible approach and also takes care of the offline part..

So does OpenCPN listen to file system events in its map directory in order to detect new files/map tiles, or do I have to invoke that somehow?
__________________
moyd is offline   Reply With Quote
Old 01-09-2014, 08:10   #6
bcn
Registered User

Join Date: May 2011
Location: underway whenever possible
Boat: Rangeboat 39
Posts: 2,760
Re: Map API - WMS Support?

Don't know about file events, but you might try it out.

There is a source for free raster charts: the whole US portfolio from NGA to play with.
It is helpful to enable "Show Chart Outlines" (Settings/Display).
And it is possible to force a database rebuilt.

Using the actual beta versions raster charts are preprocessed to optimize performance. This happens just once.
__________________
bcn is online now   Reply With Quote
Old 01-09-2014, 09:11   #7
Registered User

Join Date: Feb 2010
Location: On the go. Not in Prague.
Posts: 4,016
Re: Map API - WMS Support?

Moyd...
This stuff has been on my list since a while ago (not a single line of meaningful code written as there's other unfinished stuff higher on that list too), so a couple of notes I have taken to it.
Local cache:
  • Absolutely essential (speed, bandwidth, connection availability, TOS of most of the tile providers contain rules for repeated tile downloads to be obeyed)
  • Refer to Tile usage policy - OpenStreetMap Wiki for some insight
Tile sources:
  • "Any" tile server support through "drivers" - While the tile idea is the same everywhere, the delivery method and georeferencing differs between tile providers
  • The tile server should be user configurable (there are private tile servers and integrating some can cause issues with licenses as seen with Google Maps in all similar projects...)
Modes of display:
As I meant to support all the different types of imagery (aerial, charts, topo), all the following makes sense in some use cases
  • Dockable window (ala GE plugin, typically downsampled from the first higher tile level images)
  • (Semi)Transparent overlay (typically downsampled from the first higher tile level image)
  • Plugin chart API
  • KAP charts
    • The last two will be a bit of a challenge - how large should the are covered by the "chart" be? Will it not clutter the chartbar totally (taken into account that a chart will probably exist for every tile level - up to 20 can be available - http://wiki.openstreetmap.org/wiki/S...ap_tilenames)?
OpenCPN does not scan for new KAPs unless Chart DB update is invoked.


I was looking at https://code.google.com/p/gmapcatcher/ as a reference implementation of most of what needs to be done besides the presentation.


Looking forward to this effort, whatever help or advice you need, let us know.



Pavel
__________________
nohal is offline   Reply With Quote
Old 01-09-2014, 10:30   #8
Registered User

Join Date: Sep 2014
Posts: 7
Re: Map API - WMS Support?

Thanks for the information and the gmapcatcher project. Although Python is not my first language, that project looks very clean and useful.
__________________
moyd is offline   Reply With Quote
Old 01-09-2014, 13:24   #9
Registered User

Join Date: Sep 2014
Posts: 7
Re: Map API - WMS Support?

Quick questions for the Maps gurus out there..

As a starter I put together a small program that downloads tiles from the Norwegian WMS service. That works well, but i need to make a tradeoff in the resolutions of my maps.

I currently downloading 2048x2048px tiles, but I'm not sure how much area I should squeeze in there.. Are there any best practises I could turn to? The maps are 1:50000 scale

Once I establish that, the idea was to batch download a few areas and use the included metadata to create some KAP maps. I believe the map license would allow me to release those for free download (Need to check license first..)
__________________
moyd is offline   Reply With Quote
Old 01-09-2014, 14:11   #10
Registered User

Join Date: Feb 2010
Location: On the go. Not in Prague.
Posts: 4,016
Re: Map API - WMS Support?

moyd...
For this kind of info you can refer to the US RNC chart metadata (XML files linked from Chart Downloader for NOAA RNC&#174)

1:50000 is for example 13398_1 from http://www.charts.noaa.gov/RNCs/02Re...dCat_19115.xml

11883 x 8461px, covers 44.93333,-67.365 - 45.27,-66.66666


Pavel
__________________
nohal is offline   Reply With Quote
Old 03-09-2014, 03:39   #11
Registered User

Join Date: Sep 2014
Posts: 7
Re: Map API - WMS Support?

Thanks, although I fear I'm missing something..
According to your coordinates, this maps covers about 37416m in the lateral direction.

With image height of 8461px, this indicates that every pixel covers about 4 meters. Is that considered sufficiant resolution?

Edit: Sufficiant for costal navigation


Quote:
Originally Posted by nohal View Post
moyd...
For this kind of info you can refer to the US RNC chart metadata (XML files linked from Chart Downloader for NOAA RNC&#174)

1:50000 is for example 13398_1 from <gco:CharacterString>5161</gco:CharacterString>

11883 x 8461px, covers 44.93333,-67.365 - 45.27,-66.66666


Pavel
__________________
moyd is offline   Reply With Quote
Old 03-09-2014, 07:12   #12
Registered User

Join Date: Feb 2010
Location: On the go. Not in Prague.
Posts: 4,016
Re: Map API - WMS Support?

Moyd...
You will find an easy answer if you download the chart and look at it...
It is good enough for NOAA (That's why they created the chart like this) and it is certainly good enough for me.
In this case.
Is it good everywhere? Not at all. There are places where 1:50000 is too high a resolution and there are places where it is too low. That's why the idea of conversion to KAPs is not as brilliant as it first looks - the brain of the cartographer which decides which scale is needed for certain area (and what the area should be) is missing...

Pavel
Attached Thumbnails
Click image for larger version

Name:	Screenshot from 2014-09-03 08:05:33.jpg
Views:	113
Size:	440.8 KB
ID:	87597  
__________________
nohal is offline   Reply With Quote
Old 03-09-2014, 08:00   #13
Registered User

Join Date: Sep 2014
Posts: 7
Re: Map API - WMS Support?

Thanks yet again.

While I agree this is not an optimal solution, It should be the best(probably only) available free map covering Norway.

My intention was to recreate the norwegian paper map series, which are 1:50000 for the whole coast. There are also some specials and harbour charts that ranges from 1:5000 to 1:25000.

I have access to all the map boundaries, so planning to set up some sort of batch job for this. The license for the use of the WMS is Creative Commons, so I believe the finished product can be freely redistributed.

If nothing else its a nice exersise to keep my programming skills alive.
__________________
moyd is offline   Reply With Quote
Old 03-09-2014, 08:22   #14
Registered User

Join Date: Feb 2010
Location: On the go. Not in Prague.
Posts: 4,016
Re: Map API - WMS Support?

Moyd...
Definitely. The boundaries and scales of the official charts add part of that "brain" into the process.
I would definitely produce also some overview charts from the lower scale tiles - say representing page 17 of http://www.statkart.no/Documents/Nau...talog-2013.pdf and something similar to 302, 303 and 304. They will IMO be very useful for planning purposes. They sure have to be created from tiles of a corresponding level, not just downsampled from the high scale ones.

Pavel
__________________
nohal is offline   Reply With Quote
Old 17-01-2017, 08:09   #15
Registered User

Join Date: Jan 2017
Posts: 1
Re: Map API - WMS Support?

I'm sorry to revive this dead thread. But this is _exactly_ what I was looking for. I didn't see a source control link anywhere in the thread. Did this go anywhere? Would be nice to have something to look at.
__________________

__________________
linedance is offline   Reply With Quote
Reply

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Technical: API to query heading(s)? bushtor OpenCPN 4 03-06-2013 08:38
Plugin api coding rooiedirk OpenCPN 6 03-04-2013 09:49
C-Map NT+ Vs C-Map Max River Cruiser Marine Electronics 2 28-06-2012 10:19
c-map support bobsadler Product or Service Reviews & Evaluations 6 11-09-2008 13:07



Copyright 2002- Social Knowledge, LLC All Rights Reserved.

All times are GMT -7. The time now is 02:07.


Google+
Powered by vBulletin® Version 3.8.8 Beta 1
Copyright ©2000 - 2017, vBulletin Solutions, Inc.
Social Knowledge Networks
Powered by vBulletin® Version 3.8.8 Beta 1
Copyright ©2000 - 2017, vBulletin Solutions, Inc.

ShowCase vBulletin Plugins by Drive Thru Online, Inc.