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 Rating: Thread Rating: 4 votes, 2.00 average. Display Modes
Old 01-01-2011, 14:41   #856
Obsfucator, Second Class
 
dacust's Avatar

Join Date: Feb 2008
Location: Southeast USA.
Boat: 1982 Sea Ray SRV360
Posts: 1,745
I just ran listgeo with one of the New Zealand charts as input. Looks like there is some information in there that is not in a standard .tif.

Code:
 Directory of C:\utilities

01/01/2011  05:32 PM    <DIR>          .
01/01/2011  05:32 PM    <DIR>          ..
01/01/2011  05:31 PM           536,576 geotifcp.exe
01/01/2011  05:31 PM           552,960 listgeo.exe
08/22/2009  07:04 PM         4,062,196 nz21.tif
               3 File(s)      5,151,732 bytes
               2 Dir(s)  531,838,275,584 bytes free

C:\utilities>listgeo nz21.tif
Geotiff_Information:
   Version: 1
   Key_Revision: 1.0
   Tagged_Information:
      ModelTiepointTag (2,3):
         0                0                0
         -1576            679169           0
      ModelPixelScaleTag (1,3):
         53.3333333       53.3333333       0
      End_Of_Tags.
   Keyed_Information:
      End_Of_Keys.
   End_Of_Geotiff.


Corner Coordinates:
Upper Left    (  -1576.000, 679169.000)
Lower Left    (  -1576.000, -13737.667)
Upper Right   ( 451970.667, 679169.000)
Lower Right   ( 451970.667, -13737.667)
Center        ( 225197.333, 332715.667)
I also tested the commands in my earlier post and they do almost exactly what I guessed they would. Except, that -tfw inhibits the screen output.

So, here are the revised descriptions for the above commands.

Output to screen:
  • c:/TEMPFILE/listgeo kort142.tif

Output to file named kort142.txt:
  • c:/TEMPFILE/listgeo kort142.tif > kort142.txt

Output a kort142.tfw world file.
  • c:/TEMPFILE/listgeo -tfw kort142.tif

Here is the nz21.txt
Code:
Geotiff_Information:
   Version: 1
   Key_Revision: 1.0
   Tagged_Information:
      ModelTiepointTag (2,3):
         0                0                0
         -1576            679169           0
      ModelPixelScaleTag (1,3):
         53.3333333       53.3333333       0
      End_Of_Tags.
   Keyed_Information:
      End_Of_Keys.
   End_Of_Geotiff.


Corner Coordinates:
Upper Left    (  -1576.000, 679169.000)
Lower Left    (  -1576.000, -13737.667)
Upper Right   ( 451970.667, 679169.000)
Lower Right   ( 451970.667, -13737.667)
Center        ( 225197.333, 332715.667)
And the nz21.tfw
Code:
           53.3333333333
            0.0000000000
            0.0000000000
          -53.3333333334
        -1549.3333333333
       679142.3333333334
-dan
dacust is offline   Reply With Quote
Old 01-01-2011, 18:02   #857
Registered User
 
sinbad7's Avatar

Join Date: Sep 2003
Location: Ubatuba,SP,Brazil (Ex Norway)
Boat: (Ex) Alu. 60' yacht-"Eight Bells"
Posts: 2,731
Images: 57
Send a message via Skype™ to sinbad7
'listgeo' problem

Hi Dan.. Thanks for your advice but I still can not get any destination file output.

c:/TEMPFILE/listgeo kort196_geotiff.tif > kort196.txt

Cruisers Forum does not allow .tif files or files larger than 400 kb so I can not
send you the file which is 1.92 kb but it IS a geotiff original file.

Is any other file or filestructure required other than 'listgeo.exe' which is located in my TEMPFILE?

The geo ref's are printed on each chart in the upper right and lower left corners so manual calibration is no problem but in order to automate the conversion process we need to be able to read the geotiff header from the chart and produce an output file.

Strange why it wo'nt work. To make it easy I put the files in my C:/TEMPFILE.

Appreciate your advice.

Tore
__________________
"And all I ask is a tall ship and a star to steer her by."
sinbad7 is offline   Reply With Quote
Old 01-01-2011, 19:32   #858
Obsfucator, Second Class
 
dacust's Avatar

Join Date: Feb 2008
Location: Southeast USA.
Boat: 1982 Sea Ray SRV360
Posts: 1,745
Quote:
Originally Posted by sinbad7 View Post
Hi Dan.. Thanks for your advice but I still can not get any destination file output.

c:/TEMPFILE/listgeo kort196_geotiff.tif > kort196.txt

Cruisers Forum does not allow .tif files or files larger than 400 kb so I can not
send you the file which is 1.92 kb but it IS a geotiff original file.

Is any other file or filestructure required other than 'listgeo.exe' which is located in my TEMPFILE?

The geo ref's are printed on each chart in the upper right and lower left corners so manual calibration is no problem but in order to automate the conversion process we need to be able to read the geotiff header from the chart and produce an output file.

Strange why it wo'nt work. To make it easy I put the files in my C:/TEMPFILE.

Appreciate your advice.

Tore
You are on Windows, right? If so:
Instead of:
c:/TEMPFILE/listgeo kort196_geotiff.tif > kort196.txt
it should be
c:\TEMPFILE\listgeo kort196_geotiff.tif > kort196.txt

Also, to be absolutely sure you know where the file will go, run it like this:
  • C:
  • cd \TEMPFILE
  • listgeo kort196_geotiff.tif > kort196.txt
Then the .txt file should be in \TEMPFILE

If not, post the message it gives you.

As to it needing anything else, I have nothing but listgeo.exe and the nz21.tif in my directory and it works. (I deleted the geotifcp.exe just to make sure.)

-dan
dacust is offline   Reply With Quote
Old 02-01-2011, 02:29   #859
oem
Registered User

Join Date: Nov 2009
Location: Vejle, Denmark
Boat: Vindų 995 ds
Posts: 133
Quote:
Originally Posted by cagney View Post
But if the georef info in a geotiff can be extracted, a very lightweight script would do, like a simple rewrite of my map2kap (ozi explorer to kap).
In your particular case where you already have done the geo-referencing and only want to update your charts to include recent corrections, a rewrite of the ruby script below, that I use to give existing charts a dimming palette, would do.

Thomas
Yes I quite agree. A script taking input from either 'gdalinfo' or from 'listgeo' could be the easy solution. Not that I would be able to do it, I'm hardly able to do c-programming and I don't know much abount projections and datums, but I agree.

But I am a little tired of 'half' solutions. It took me long time to make the mc2bsbh-solution work originally. Not that there is something wrong with it, I'm grateful indeed for all the work that has been put into it. Without mc2bsbh(with Mapcal), no OpenCPN for me. But still, somehow I'd like something easyer and more automatic. For example re-using the valid geopoints somewhere in my source charts.

Working with OpenCPN (outside NOAA-areas) is a lot of manual work, -commands, scripts, copying, testing etc. with the purpose of making charts ready in BSB-format. I wish that could be made easyer. And in my case it should be possible.

And I'm sort of obsessed by the code in gdal and products based on gdal. Yesterday I upgraded QGis to 1.6.0 and found many improvements concerning geo-referencing. But I'm not sure of the functionality yet. Could be a replacement/supplement to Mapcal. It's so close. And there is lots of code and formats covered.

Thanks for input and help :-)
oem is offline   Reply With Quote
Old 02-01-2011, 03:06   #860
Obsfucator, Second Class
 
dacust's Avatar

Join Date: Feb 2008
Location: Southeast USA.
Boat: 1982 Sea Ray SRV360
Posts: 1,745
Quote:
Originally Posted by oem View Post
Yes I quite agree. A script taking input from either 'gdalinfo' or from 'listgeo' could be the easy solution. Not that I would be able to do it, I'm hardly able to do c-programming and I don't know much abount projections and datums, but I agree.

But I am a little tired of 'half' solutions. It took me long time to make the mc2bsbh-solution work originally. Not that there is something wrong with it, I'm grateful indeed for all the work that has been put into it. Without mc2bsbh(with Mapcal), no OpenCPN for me. But still, somehow I'd like something easyer and more automatic. For example re-using the valid geopoints somewhere in my source charts.

Working with OpenCPN (outside NOAA-areas) is a lot of manual work, -commands, scripts, copying, testing etc. with the purpose of making charts ready in BSB-format. I wish that could be made easyer. And in my case it should be possible.

And I'm sort of obsessed by the code in gdal and products based on gdal. Yesterday I upgraded QGis to 1.6.0 and found many improvements concerning geo-referencing. But I'm not sure of the functionality yet. Could be a replacement/supplement to Mapcal. It's so close. And there is lots of code and formats covered.

Thanks for input and help :-)
If you could point me to a source of geotiffs I can download, I'll take a look at it.

Preferably some with, and some without borders. And some of various projections would also be nice.

-dan
dacust is offline   Reply With Quote
Old 02-01-2011, 03:49   #861
Registered User

Join Date: Dec 2005
Location: Helsingborg
Boat: Dufour 35
Posts: 3,891
Dan,Tore, oem ...

Seems gdal is the way to go.
Download sample aussie geotiff here Australian Hydrographic Service - Seafarer® GeoTIFF Evaluation Sample Data Cell
Using "gdalinfo" outputs a lot of useful info:
Quote:
$ gdalinfo /home/thomas/Downloads/AUS00605/A00605.tif
Driver: GTiff/GeoTIFF
Files: /home/thomas/Downloads/AUS00605/A00605.tif
Size is 7255, 6134
Coordinate System is:
GEOGCS["WGS 84",
DATUM["WGS_1984",
SPHEROID["WGS 84",6378137,298.2572235630016,
AUTHORITY["EPSG","7030"]],
AUTHORITY["EPSG","6326"]],
PRIMEM["Greenwich",0],
UNIT["degree",0.0174532925199433],
AUTHORITY["EPSG","4326"]]
Origin = (66.550929651323713,-49.499986986443652)
Pixel Size = (0.002037346392970,-0.001222235908600)
Metadata:
AREA_OR_POINT=Area
TIFFTAG_DOCUMENTNAME=0hcmap2g178612.hrf
TIFFTAG_IMAGEDESCRIPTION=Converted from HRF.
TIFFTAG_XRESOLUTION=254
TIFFTAG_YRESOLUTION=254
TIFFTAG_RESOLUTIONUNIT=2 (pixels/inch)
Image Structure Metadata:
COMPRESSION=PACKBITS
INTERLEAVE=BAND
Corner Coordinates:
Upper Left ( 66.5509297, -49.4999870) ( 66d33'3.35"E, 49d29'59.95"S)
Lower Left ( 66.5509297, -56.9971820) ( 66d33'3.35"E, 56d59'49.86"S)
Upper Right ( 81.3318777, -49.4999870) ( 81d19'54.76"E, 49d29'59.95"S)
Lower Right ( 81.3318777, -56.9971820) ( 81d19'54.76"E, 56d59'49.86"S)
Center ( 73.9414037, -53.2485845) ( 73d56'29.05"E, 53d14'54.90"S)
Band 1 Block=7255x100 Type=Byte, ColorInterp=Palette
Color Table (RGB with 256 entries)
0: 0,0,0,255
1: 255,255,255,255
...
...
This is the kind of info we need to automate the process....
Now looking at existing scripts on the net.

Thomas
cagney is offline   Reply With Quote
Old 02-01-2011, 03:58   #862
Registered User
 
sinbad7's Avatar

Join Date: Sep 2003
Location: Ubatuba,SP,Brazil (Ex Norway)
Boat: (Ex) Alu. 60' yacht-"Eight Bells"
Posts: 2,731
Images: 57
Send a message via Skype™ to sinbad7
Dan.. Still not working and I am wondering if the listgeo.exe is faulty?
C:\listgeo kort196_geotiff.tif > kortnew.txt (Moved to main C:\ dir)

If I substitute with geotifcp like this C:\geotifcp kort196_geotiff.tif > kort196.txt it generates a file with strange content,mostly encrypted it seems.

However,it proves that it finds and generates files.

Could you be so kind as to send me a copy of YOUR listgeo.exe to my email tore@yachtmarine.com to test.

Regasrds
Tore
__________________
"And all I ask is a tall ship and a star to steer her by."
sinbad7 is offline   Reply With Quote
Old 02-01-2011, 04:29   #863
Registered User

Join Date: Jul 2010
Location: Hannover - Germany
Boat: Amel Sharki
Posts: 2,547
Sorry Tore, but it seems you will need a lesson for computer basics.
Never use the root directory for personal files! Neither with Windows (usually "C:\" ) nor with Linux, Ubuntu, Mac (usually "/" ) or any other operating system!
Always use your "My Documents" section for creating subdirs, files etc.
Otherwise you will have a good chance to crash your operating system.
CarCode is offline   Reply With Quote
Old 02-01-2011, 05:16   #864
Registered User
 
sinbad7's Avatar

Join Date: Sep 2003
Location: Ubatuba,SP,Brazil (Ex Norway)
Boat: (Ex) Alu. 60' yacht-"Eight Bells"
Posts: 2,731
Images: 57
Send a message via Skype™ to sinbad7
CarCode.. Yes thanks, I am aware of that. If you had been following this thread you would have seen I am testing all possibilities to execute a file and for test purpose only I also tried the main C: dir.

I am now trying to see if it will work in my desktop running XP. Perhaps it is a Vista problem.

Tore
__________________
"And all I ask is a tall ship and a star to steer her by."
sinbad7 is offline   Reply With Quote
Old 02-01-2011, 05:30   #865
Registered User
 
sinbad7's Avatar

Join Date: Sep 2003
Location: Ubatuba,SP,Brazil (Ex Norway)
Boat: (Ex) Alu. 60' yacht-"Eight Bells"
Posts: 2,731
Images: 57
Send a message via Skype™ to sinbad7
Dan.. I“ve downloaded a fresh listgeo.exe to my desktop running under XP and executed the following from the command line: c:\Temporary\listgeo kort196_geotiff.tif > kort196.txt
but still,no file generated... all the files are in the C:\Temporary\ directory..

If I substitute geotifcp,it creates the file kort196.txt with unreadable stuff.

Very strange indeed....

Tore
__________________
"And all I ask is a tall ship and a star to steer her by."
sinbad7 is offline   Reply With Quote
Old 02-01-2011, 06:44   #866
Registered User
 
sinbad7's Avatar

Join Date: Sep 2003
Location: Ubatuba,SP,Brazil (Ex Norway)
Boat: (Ex) Alu. 60' yacht-"Eight Bells"
Posts: 2,731
Images: 57
Send a message via Skype™ to sinbad7
I am running Windows Vista. When I run a comman line, the result frame just flashes on the screen for a second,how do you retain the result of a command line ON SCREEN so it can be examined? As I am unsuccessful saving the result in a file,at least I might be able to read the result.

Tore
__________________
"And all I ask is a tall ship and a star to steer her by."
sinbad7 is offline   Reply With Quote
Old 02-01-2011, 07:14   #867
Registered User
 
sinbad7's Avatar

Join Date: Sep 2003
Location: Ubatuba,SP,Brazil (Ex Norway)
Boat: (Ex) Alu. 60' yacht-"Eight Bells"
Posts: 2,731
Images: 57
Send a message via Skype™ to sinbad7
FINALLY!! Manually moved to the directory containing the relevant prog/files
and executed the command line which created the file first time..
Somehow it does not find directories automatically. I have a Norwegian version of Vista where some of the directories seems to be read differently.

Here's the geotiff header:

Geotiff_Information:
Version: 1
Key_Revision: 1.0
Tagged_Information:
ModelTransformationTag (4,4):
12.7012436 -0.00022111422 0 602445.848
-0.000231649892 -12.7023198 0 371054.509
0 0 1 0
0 0 0 0
End_Of_Tags.
Keyed_Information:
ProjectedCSTypeGeoKey (Short,1): Unknown-50003
PCSCitationGeoKey (Ascii,1): ""
ProjLinearUnitsGeoKey (Short,1): Linear_Meter
Unknown-45416 (Short,1): Unknown-463
Unknown-45417 (Double,12): 0 0 0
5565 0 0
5565 3932 0
0 3932 0
Unknown-45419 (Ascii,12): "S/75000 196"
Unknown-45420 (Double,1): 75000
Unknown-45421 (Double,3): 8 2010 31
Unknown-45423 (Ascii,8): "dm_ed50"
Unknown-45428 (Ascii,1): ""
Unknown-45429 (Double,7): 8 2010 8
2010 8 31
2010
Unknown-45430 (Ascii,15): "DK2000_soekort"
End_Of_Keys.
End_Of_Geotiff.

PCS = -15533 (name unknown)
Projection Linear Units: 9001/metre (1.000000m)

Corner Coordinates:
Upper Left ( 602445.848, 371054.509)
Lower Left ( 602444.979, 321108.987)
Upper Right ( 673128.269, 371053.220)
Lower Right ( 673127.399, 321107.698)
Center ( 637786.624, 346081.104)

The question is, how do you convert the above coordinates to geo locations?
'gdalinfo' has more explicit geo info it seems.


Is 'gdalinfo' a stand alone program or does it need other modules to work?
Is it free to download and use?

Tore
Attached Thumbnails
Click image for larger version

Name:	Screenshot_01 Jan. 02 13.08.jpg
Views:	179
Size:	25.0 KB
ID:	22441  
__________________
"And all I ask is a tall ship and a star to steer her by."
sinbad7 is offline   Reply With Quote
Old 02-01-2011, 07:55   #868
oem
Registered User

Join Date: Nov 2009
Location: Vejle, Denmark
Boat: Vindų 995 ds
Posts: 133
Quote:
Originally Posted by sinbad7 View Post
FINALLY!! Manually moved to the directory containing the relevant prog/files
and executed the command line which created the file first time..
Somehow it does not find directories automatically. I have a Norwegian version of Vista where some of the directories seems to be read differently.

Here's the geotiff header:

Geotiff_Information:
Version: 1
Key_Revision: 1.0
Tagged_Information:
ModelTransformationTag (4,4):
12.7012436 -0.00022111422 0 602445.848
-0.000231649892 -12.7023198 0 371054.509
0 0 1 0
0 0 0 0
End_Of_Tags.
Keyed_Information:
ProjectedCSTypeGeoKey (Short,1): Unknown-50003
PCSCitationGeoKey (Ascii,1): ""
ProjLinearUnitsGeoKey (Short,1): Linear_Meter
Unknown-45416 (Short,1): Unknown-463
Unknown-45417 (Double,12): 0 0 0
5565 0 0
5565 3932 0
0 3932 0
Unknown-45419 (Ascii,12): "S/75000 196"
Unknown-45420 (Double,1): 75000
Unknown-45421 (Double,3): 8 2010 31
Unknown-45423 (Ascii,8): "dm_ed50"
Unknown-45428 (Ascii,1): ""
Unknown-45429 (Double,7): 8 2010 8
2010 8 31
2010
Unknown-45430 (Ascii,15): "DK2000_soekort"
End_Of_Keys.
End_Of_Geotiff.

PCS = -15533 (name unknown)
Projection Linear Units: 9001/metre (1.000000m)

Corner Coordinates:
Upper Left ( 602445.848, 371054.509)
Lower Left ( 602444.979, 321108.987)
Upper Right ( 673128.269, 371053.220)
Lower Right ( 673127.399, 321107.698)
Center ( 637786.624, 346081.104)
So the challenge is now to transform that chart to a valid BSB-chart, readable by OpenCPN.

'gdal_translate -of BSB yourchart.tif yourchart.kap' produces a BSB chart, but it's not readable by Opencpn, since it does not contain any REF's. It's problable something to do with the 'dm_ed50' and the format of the corner coordinates corresponding hereto. It has to be WGS84 or NAD83, I think, for gdal_translate.

I have tried with various gdalwarp-commands and various EPSG:23032, EPSG:4230 and EPSG:4326 etc. Without success. Then I tried to hardcode (in Gdal with VS2008 express) to confirm that the BSB-file could be readable by Opencpn. The answer was yes :-)

I tried then to read/understand some parts of the gdal_translate.cpp flow, but I'm unfortunately not mentally capable of debugging the code :-)

Then I found and downloaded an updated QGIS 1.6.0 and tried to georeference again and make a transformed Gtiff-file that would conform to WGS84. With gdal_translate as above a KAP file would then contain some REF's, but still not readable by OpenCpn. But I got a little further.

QGis has some interesting georererending possibilities, e.g. to georeference a new chart from an already georerenced one (from same area). That's why QGis could supplement/replace the Mapcal-program, and also offer Open source, integrated with GDAL. Also QGis creates a .points-file, with the GCP's. That file could be used in a scripting-solution as discussed above. Also QGis can view/edit S57-chart files!

That's where I am now.

So my conclusion is that I have not been able to produce a readable BSB-chart from a Gtiff-format yet. Maybe it's because there is something I don't understand (some projection/datum-stuff), maybe it's because it's not possible (with GDAL). Maybe because my GTiff-files do not contain sufficient information (which I then tried to supplement with QGis, without success).

I can see that Tore's chart has the same origin and format as mine, so we seem to work on the same issue :-)

What's my 'goal'?
1) First: A more automatic and secure chart-production from Gtiff (and possibly more formats in GDAL) to BSB3 (for OpenCPN)
2) Second: Investigate further georeferencing possibilities, open source, beside Mapcal, with better integration to other formats, like S57 and KML/KMZ.
3) Third: Take a small step up the learning curve.
4) Fourth: Consider the possibility for an open source sea-chart production facility, like OpenSeaMap. In QGis, an interface to OSM is already there.

That's all :-)
oem is offline   Reply With Quote
Old 02-01-2011, 08:33   #869
Registered User
 
sinbad7's Avatar

Join Date: Sep 2003
Location: Ubatuba,SP,Brazil (Ex Norway)
Boat: (Ex) Alu. 60' yacht-"Eight Bells"
Posts: 2,731
Images: 57
Send a message via Skype™ to sinbad7
oem.. Well,at least it will keep you off the street while the snow blocks your paths.. he he

With my present facilities I can convert an OpenCPN compatible .kap chart in a few minutes so I will await further developments from our 'nerds' with more ability and stamina than mine.

The .it charts you mentioned probably cover the same areas as the same .GTiff bitmaps so any conversion is probably un neccessary. Could be interesting from other areas in Scandinavia though. KEEP SEARCHING!!

Tore
__________________
"And all I ask is a tall ship and a star to steer her by."
sinbad7 is offline   Reply With Quote
Old 03-01-2011, 04:48   #870
Registered User
 
sinbad7's Avatar

Join Date: Sep 2003
Location: Ubatuba,SP,Brazil (Ex Norway)
Boat: (Ex) Alu. 60' yacht-"Eight Bells"
Posts: 2,731
Images: 57
Send a message via Skype™ to sinbad7
Dan...

What does the corner coordinate values below represent?
How do I convert it to geo locations,if that is what it is?

Corner Coordinates: (from 'listgeo')
Upper Left ( -1576.000, 679169.000)
Lower Left ( -1576.000, -13737.667)
Upper Right ( 451970.667, 679169.000)
Lower Right ( 451970.667, -13737.667)
Center ( 225197.333, 332715.667)

Tore
__________________
"And all I ask is a tall ship and a star to steer her by."
sinbad7 is offline   Reply With Quote
Reply

Tags
charts, kml, raster2bsb, tiff2bsb, bsb


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
Charts on CD stxboy Navigation 43 28-01-2014 10:40
Charts for BC Charlie Navigation 11 19-04-2007 03:39
Used Charts daven Navigation 2 28-11-2006 16:47
Looking at charts - where to go to next Rippy Other 19 10-03-2006 04:27

Advertise Here


All times are GMT -7. The time now is 03:25.


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.