Cruisers Forum
 


Reply
  This discussion is proudly sponsored by:
Please support our sponsors and let them know you heard about their products on Cruisers Forums. Advertise Here
 
Thread Tools Search this Thread Rate Thread Display Modes
Old 22-04-2017, 18:25   #1
gfh
Registered User
 
gfh's Avatar

Join Date: Feb 2013
Location: NJ
Posts: 25
geoTIFF in OpenCPN?

Hello,

Is there an easier way to display a geoTIFF in OpenCPN?

The USGS flew green-laser lidar over my state and made very accurate depth soundings of the bottom at 1m resolution. I thought it would be interesting to use it to make visualizations of the bottom contours so that I could better understand the currents and find the deeper parts of some of the smaller, uncharted or inaccurately-charted tributaries. I've been able to do some pretty cool stuff with it already using QGIS and GDAL, and I can overlay it on a webpage, but I'd really like to be able to pull it up as a "chart" in OpenCPN. Here's an example of what they look like when hillshaded, tiled, and placed over an OpenStreetMap basemap:

https://sailingfortuitous.com/nobuoy/test.html

I've done a bunch of research for how to get it into OpenCPN, and I've gone down a long rabbit hole trying to use tiff2bsb/imgkap to try to convert to a format that OpenCPN will like, but I can't figure out how to make a template.kap file that will work...I don't have the data for things like "scale" or "the latitude where the scale is valid." I feel like there's got to be a way to get around this since it's a geoTIFF (not a basic image TIFF) and is already spatially-enabled.
__________________
sailingfortuitous.com
gfh is offline   Reply With Quote
Old 22-04-2017, 19:22   #2
Registered User

Join Date: Aug 2009
Location: oriental
Boat: crowther trimaran 33
Posts: 4,417
Re: geoTIFF in OpenCPN?

Quote:
Originally Posted by gfh View Post
Hello,

Is there an easier way to display a geoTIFF in OpenCPN?

The USGS flew green-laser lidar over my state and made very accurate depth soundings of the bottom at 1m resolution. I thought it would be interesting to use it to make visualizations of the bottom contours so that I could better understand the currents and find the deeper parts of some of the smaller, uncharted or inaccurately-charted tributaries. I've been able to do some pretty cool stuff with it already using QGIS and GDAL, and I can overlay it on a webpage, but I'd really like to be able to pull it up as a "chart" in OpenCPN. Here's an example of what they look like when hillshaded, tiled, and placed over an OpenStreetMap basemap:

https://sailingfortuitous.com/nobuoy/test.html

I've done a bunch of research for how to get it into OpenCPN, and I've gone down a long rabbit hole trying to use tiff2bsb/imgkap to try to convert to a format that OpenCPN will like, but I can't figure out how to make a template.kap file that will work...I don't have the data for things like "scale" or "the latitude where the scale is valid." I feel like there's got to be a way to get around this since it's a geoTIFF (not a basic image TIFF) and is already spatially-enabled.
Can green lasers work even if the water isn't clear? How deep is it? Is there vector data or soundings?

I believe there are some programs that can easily convert geotiff into kap. Did you try qgis or grass?

I am more interested in supporting geojpeg or something similar as a native chart format. jpeg compression offers the same quality at 15% the disk space for aerial imagery.
seandepagnier is offline   Reply With Quote
Old 22-04-2017, 21:00   #3
gfh
Registered User
 
gfh's Avatar

Join Date: Feb 2013
Location: NJ
Posts: 25
Re: geoTIFF in OpenCPN?

I don't know how the LIDAR works, but it works. The output is raster data. Each 1m x 1m cell has an elevation associated with it, including "elevations" below the water level. I converted it to a hillshade image to visualize the bottom contours on a web map:

https://sailingfortuitous.com/contours/

I can't figure out how to convert them to a chart format though. QGIS (which I think is just acting as a front end for GDAL) has like 50 things it can convert to, but I don't see BSB/KAP in the list.
__________________
sailingfortuitous.com
gfh is offline   Reply With Quote
Old 22-04-2017, 22:49   #4
Moo
Registered User

Join Date: Mar 2017
Posts: 804
Re: geoTIFF in OpenCPN?

I use GE2KAP to convert geotiffs to KAP.. bit of learning to do but all the info is in the help files.
Moo is offline   Reply With Quote
Old 23-04-2017, 07:56   #5
Registered User
 
HappySeagull's Avatar

Join Date: Dec 2010
Location: B.C.,Canada
Boat: 29'
Posts: 2,423
Re: geoTIFF in OpenCPN?

GeoTiffs can be/often are? calibrated as UTM as their embedded info...you might find this in the exif or ? "JPTIC"??(can't remember exactly without pulling it up ) in a picture viewer..
But you need mercator or (possible TM transverse mercator) calibration....

Also, embedded heights are useless so a flat picture like you have created is where to start. You need corner positions as Lat-Long to make it easy- perhaps you have these? Otherwise

usually the problem with the method you describe (tiff2bsb) is in the colours. You can only have 127! so check your image and reduce colours...in fact, best to reduce to 8,16,64 work fine on any chart /map to kap.

using imgkap alone is best because it doesn't care so much about numbers of colours and will reduce these....and will do all the work including spitting out an error with corrections if the image itself is sized wrong per proportions of pixels as lat and long. However, you can get sizing pretty close if you make sure a degree of longitude in pixels is sized to equal the cos of a degree of (central) latitude in pixels, proportionately. (Mercator)

The image you have looks pretty good as to proportion but huge mbs images are not required...your resolution can be too fine so cutting it up into smaller bits will give you more workable and detailed kaps ...most kaps when finished are only 3 or 4 mb after all...
Code:
 imgkap imagename.extension upperleft-lat upperleft-long lowerright-lat lowerright-long outputkap.kap
is all you need. tip: use quote marks around image names that include spaces..
When you get rolling, you can just type up a list of many images to be converted,as above, change the name of your list to ".cmd", and slip it into where imgkap.exe and all your pictures are and double-click it. I've done lots and lots of Canadian Geotiffs this way, but, these come with a separate file that has lat long corners noted so that made it easier than yours maybe.

You might try something called GeoMetaData_Extractor...FWTools: Open Source GIS/RS Binary Kit
HappySeagull is offline   Reply With Quote
Old 23-04-2017, 16:21   #6
gfh
Registered User
 
gfh's Avatar

Join Date: Feb 2013
Location: NJ
Posts: 25
Re: geoTIFF in OpenCPN?

Thanks for the detailed response. Initial tests are resulting in errors, but I'll keep messing with the projection/pixel size and see if I can make it work.

Code:
imgkap cedarCreekHillShade.tif -74.1746985289037184 39.8615167389736484 -74.1252710313236349 39.8780942741702589 cedarCreek.kap
ERROR - size of image is not correct
        Extend widthin 4211 heightin 1800 to widthout 4211 heightout 45948
ERROR - imgkap return 2
__________________
sailingfortuitous.com
gfh is offline   Reply With Quote
Old 23-04-2017, 16:31   #7
Registered User

Join Date: Aug 2009
Location: oriental
Boat: crowther trimaran 33
Posts: 4,417
Re: geoTIFF in OpenCPN?

Why don't you post one of these geotiff here?
seandepagnier is offline   Reply With Quote
Old 23-04-2017, 16:37   #8
gfh
Registered User
 
gfh's Avatar

Join Date: Feb 2013
Location: NJ
Posts: 25
Re: geoTIFF in OpenCPN?

Quote:
Originally Posted by boat_alexandra View Post
Why don't you post one of these geotiff here?
It's too big (7.5MB). I put it here for download if you'd like to see it:

https://sailingfortuitous.com/nobuoy...kHillShade.tif
__________________
sailingfortuitous.com
gfh is offline   Reply With Quote
Old 23-04-2017, 21:48   #9
Registered User
 
sailorF54's Avatar

Join Date: Dec 2009
Location: Perros-Guirec, France
Boat: Jeanneau Sunshine 36
Posts: 999
Re: geoTIFF in OpenCPN?

GE2KAP does a good job
Attached Thumbnails
Click image for larger version

Name:	ScreenShot.JPG
Views:	154
Size:	142.5 KB
ID:	146135   Click image for larger version

Name:	ScreenShot 001.jpg
Views:	152
Size:	246.9 KB
ID:	146136  

sailorF54 is offline   Reply With Quote
Old 24-04-2017, 13:29   #10
Registered User

Join Date: Aug 2009
Location: oriental
Boat: crowther trimaran 33
Posts: 4,417
Re: geoTIFF in OpenCPN?

How do you get depth out?

Can this be used to render sounding numbers into the image or convert it to a vector chart?
seandepagnier is offline   Reply With Quote
Old 25-04-2017, 08:11   #11
Registered User
 
HappySeagull's Avatar

Join Date: Dec 2010
Location: B.C.,Canada
Boat: 29'
Posts: 2,423
Re: geoTIFF in OpenCPN?

Quote:
Originally Posted by gfh View Post
Thanks for the detailed response. Initial tests are resulting in errors, but I'll keep messing with the projection/pixel size and see if I can make it work.

Code:
imgkap cedarCreekHillShade.tif -74.1746985289037184 39.8615167389736484 -74.1252710313236349 39.8780942741702589 cedarCreek.kap
ERROR - size of image is not correct
        Extend widthin 4211 heightin 1800 to widthout 4211 heightout 45948
ERROR - imgkap return 2
Yes that's a pretty wild change imgkap is suggesting! 4211x45948! Latitudes and longitudes swapped? I see you are in NJ?
I do note your positions are impossibly detailed. Ants don't navigate on that scale. I'm thinking it's molecular...3 or 4 decimal places is about as good as it gets .

try
Code:
 imgkap cedarCreekHillShade.tif 39.8780 -74.1746 39.8615 -74.1252 cedarCreek.kap
double check me for spaces what all. It seemed to work great here no errors but I have to load into O to see....plainly something amiss with your command line though.
HappySeagull is offline   Reply With Quote
Old 25-04-2017, 09:12   #12
Registered User
 
HappySeagull's Avatar

Join Date: Dec 2010
Location: B.C.,Canada
Boat: 29'
Posts: 2,423
Re: geoTIFF in OpenCPN?

yes, it seems not bad. However there's a bit ofslippage as to position- see blackness west side. There's Marks I made in Opencpn equalling corners input. I don't keep a lot of East Coast us charts so overlay isn't plain but seems close to cm93

Click image for larger version

Name:	cedarCreek.jpg
Views:	138
Size:	64.5 KB
ID:	146236


I looked at the embedded notes in the tiff. Indeed is UTM, NAD83 like Canada.
HappySeagull is offline   Reply With Quote
Old 25-04-2017, 10:10   #13
Registered User
 
HappySeagull's Avatar

Join Date: Dec 2010
Location: B.C.,Canada
Boat: 29'
Posts: 2,423
Re: geoTIFF in OpenCPN?

anyways Very interesting what you've done gfh...this is looking somewhat familiar to me. I was fiddling around with other applications per dems and kap making ...DEM2TOPO and 3DEM just to simplify away from large installations and if you have the actual DEMS... might be worth a look (next winter haha).
HappySeagull is offline   Reply With Quote
Old 25-04-2017, 10:31   #14
Registered User

Join Date: Feb 2011
Posts: 1,108
Re: geoTIFF in OpenCPN?

This place is Glen Cedars in New Jersey.
See the image from google earth.
P_Dub is offline   Reply With Quote
Old 25-04-2017, 21:54   #15
gfh
Registered User
 
gfh's Avatar

Join Date: Feb 2013
Location: NJ
Posts: 25
Re: geoTIFF in OpenCPN?

Quote:
Originally Posted by HappySeagull View Post
Yes that's a pretty wild change imgkap is suggesting! 4211x45948! Latitudes and longitudes swapped? I see you are in NJ?
I do note your positions are impossibly detailed. Ants don't navigate on that scale. I'm thinking it's molecular...3 or 4 decimal places is about as good as it gets .

try
Code:
 imgkap cedarCreekHillShade.tif 39.8780 -74.1746 39.8615 -74.1252 cedarCreek.kap
double check me for spaces what all. It seemed to work great here no errors but I have to load into O to see....plainly something amiss with your command line though.
This totally worked...thanks so much for your help. I just had the lat/longs all out of order.
Attached Thumbnails
Click image for larger version

Name:	snip.jpg
Views:	147
Size:	420.7 KB
ID:	146268  
__________________
sailingfortuitous.com
gfh is offline   Reply With Quote
Reply

Tags
enc, opencpn


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
GEOTIFF MARINE MAPS TO KAP WITH GE2KAP sinbad8 OpenCPN 0 04-10-2015 08:34
Extracting geo loc from Geotiff.tif maps sinbad8 Navigation 0 07-09-2015 13:25
GEOTIFF PIXELS TO LATLON COORDS sinbad7 OpenCPN 0 04-04-2012 07:10
Virtual OpenCPN - 'OpenCPN on a Stick' r.fairman OpenCPN 23 16-10-2011 19:51
Marine GeoTiff - Open Chart Standard dacust OpenCPN 12 04-11-2009 17:43

Advertise Here


All times are GMT -7. The time now is 21:31.


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

ShowCase vBulletin Plugins by Drive Thru Online, Inc.