Re: [osg-users] Convert/use GIS coordinates
Hi Norman, gdalwarp -s_srs WGS84 -t_srs EPSG:32618 32V.tif 32V_warped.tif That turns the image all black (no height values)... You left the units=m out of your proj4 string I also tried gdalwarp -s_srs WGS84 -t_srs +proj=utm +zone=32 +ellps=WGS84 +datum=WGS84 +units=m +no_defs 32V.tif 32V_warped.tif following the links you posted, and it also turns the image (32V_warped.tif) all black. Same result, so I guess both are equivalent, but not what I had in mind... Anyways, I've sent the image to Glenn to see what he can find out. Thanks, J-S -- __ Jean-Sebastien Guay[EMAIL PROTECTED] http://www.cm-labs.com/ http://whitestar02.webhop.org/ ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Convert/use GIS coordinates
J-S, Thanks for the files. I was able to use them to make it work. The problem was that the original TIFF had go spatial information. So, I assigned it the proper SRS with: gdal_translate -a_srs WGS84 32V.tif 32V.wgs84.tif Then I was able to reproject it into UTM: gdalwarp -t_srs +proj=utm +zone=32 +datum=WGS84 +units=m 32V.wgs84.tif 32V.utm.tif And finally a test run through osgdem: osgdem --terrain -d 32V.utm.tif -o out.osg And that yields a good UTM dataset. Glenn On Thu, Jun 26, 2008 at 8:47 AM, Jean-Sébastien Guay [EMAIL PROTECTED] wrote: Hi Norman, gdalwarp -s_srs WGS84 -t_srs EPSG:32618 32V.tif 32V_warped.tif That turns the image all black (no height values)... You left the units=m out of your proj4 string I also tried gdalwarp -s_srs WGS84 -t_srs +proj=utm +zone=32 +ellps=WGS84 +datum=WGS84 +units=m +no_defs 32V.tif 32V_warped.tif following the links you posted, and it also turns the image (32V_warped.tif) all black. Same result, so I guess both are equivalent, but not what I had in mind... Anyways, I've sent the image to Glenn to see what he can find out. Thanks, J-S -- __ Jean-Sebastien Guay[EMAIL PROTECTED] http://www.cm-labs.com/ http://whitestar02.webhop.org/ ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org -- Glenn Waldron : Pelican Mapping : http://pelicanmapping.com : 703-652-4791 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Convert/use GIS coordinates
Hi Glenn, Thanks for the files. I was able to use them to make it work. The problem was that the original TIFF had geo spatial information. OK, great, works here too. I'll have to take some notes so I don't make the same mistake in the future. I just assumed that since gdalinfo gave the lat/long in degrees, that the tiff was fine. Now I know that I need to look for the GEOGCS stuff. Follow-up question: the resulting reprojected image has the terrain rotated a bit, which gives borders at the top-left and bottom-right of the image. This also gives terrain that looks higher in the generated terrain. Is there some way to remove that? Finally, is there some way to know what the ocean level is (or can I just approximate it at z=0)? Thanks a lot, J-S -- __ Jean-Sebastien Guay[EMAIL PROTECTED] http://www.cm-labs.com/ http://whitestar02.webhop.org/ ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Convert/use GIS coordinates
On Thu, Jun 26, 2008 at 9:35 AM, Jean-Sébastien Guay [EMAIL PROTECTED] wrote: Hi Glenn, Thanks for the files. I was able to use them to make it work. The problem was that the original TIFF had geo spatial information. OK, great, works here too. I'll have to take some notes so I don't make the same mistake in the future. I just assumed that since gdalinfo gave the lat/long in degrees, that the tiff was fine. Now I know that I need to look for the GEOGCS stuff. Follow-up question: the resulting reprojected image has the terrain rotated a bit, which gives borders at the top-left and bottom-right of the image. This also gives terrain that looks higher in the generated terrain. Is there some way to remove that? Well, since a UTM zone represents a vertical slice of the earth, it won't be perfectly rectangular -- in the northern hemisphere, the width at the north side (in meters) is less than the width at the south. Since a TIFF is rectangular, you see borders. The only way to compensate would be to stitch multiple areas together and then crop out a rectangular region. Does that answer your question? I don't know what you mean by higher. Finally, is there some way to know what the ocean level is (or can I just approximate it at z=0)? Z=0 at sea level. -- Glenn Waldron : Pelican Mapping : http://pelicanmapping.com : 703-652-4791 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Convert/use GIS coordinates
Hi Glenn, Well, since a UTM zone represents a vertical slice of the earth, it won't be perfectly rectangular -- in the northern hemisphere, the width at the north side (in meters) is less than the width at the south. Since a TIFF is rectangular, you see borders. The only way to compensate would be to stitch multiple areas together and then crop out a rectangular region. Does that answer your question? I gathered that was the reason, but didn't know what could be done about it. I don't know what you mean by higher. Well, the places where there is no data get rendered as higher terrain than the bottom of the ocean... Sorry for the simplistic terms. Z=0 at sea level. Excellent. Thanks J-S -- __ Jean-Sebastien Guay[EMAIL PROTECTED] http://www.cm-labs.com/ http://whitestar02.webhop.org/ ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Convert/use GIS coordinates
On Thu, Jun 26, 2008 at 10:08 AM, Jean-Sébastien Guay [EMAIL PROTECTED] wrote: Hi Glenn, Well, since a UTM zone represents a vertical slice of the earth, it won't be perfectly rectangular -- in the northern hemisphere, the width at the north side (in meters) is less than the width at the south. Since a TIFF is rectangular, you see borders. The only way to compensate would be to stitch multiple areas together and then crop out a rectangular region. Does that answer your question? I gathered that was the reason, but didn't know what could be done about it. I don't know how to do it from the command line. I use Global Mapper for this sort of thing. I find it to be an indispensable companion to VPB for prepping source data. I don't know what you mean by higher. Well, the places where there is no data get rendered as higher terrain than the bottom of the ocean... Sorry for the simplistic terms. Right, gdalwarp fills in the reprojection gaps with Z=0. Not sure whether gdalwarp can insert custom no-data values (-dstnodata maybe?) -- Glenn Waldron : Pelican Mapping : http://pelicanmapping.com : 703-652-4791 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Convert/use GIS coordinates
Hi Glenn, Bottom line: if you use VPB to build a terrain in UTM zone 32 (or whatever), you will need to do no coordinate conversion. I'm currently doing some tests with some data I got from http://www.ngdc.noaa.gov/mgg/image/2minrelief.html (pretty low res, but I'm just testing). The problem I have is that the data's positions seem to be in latitude/longitude in degrees, and I'd like to convert it to what I'm expecting (meters). I'm not very familiar with the tools (I assume GDAL and/or PROJ can do this), so I'd appreciate a hand :-) gdalinfo gives me this for the file I have: Driver: EHdr/ESRI .hdr Labelled Files: Hellobob_5209.bin Hellobob_5209.hdr Size is 271, 241 Coordinate System is `' Origin = (2.9833500,64.01666586493) Pixel Size = (0.0333000,-0.0333000) Corner Coordinates: Upper Left ( 2.983, 64.0166659) Lower Left ( 2.983, 55.983) Upper Right ( 12.0166658, 64.0166659) Lower Right ( 12.0166658, 55.983) Center ( 7.496, 59.996) Band 1 Block=271x1 Type=Byte, ColorInterp=Undefined NoData Value=99 So as you can see, ~(3, 56) to ~(12,64) in degrees. I'd like to have that in meters in the right place on the Earth... How would I do that? On the gdal_translate man page I see the option a_srs overrides the projection of the output file, but I have no idea what the argument should be. Thanks in advance, J-S -- __ Jean-Sebastien Guay[EMAIL PROTECTED] http://www.cm-labs.com/ http://whitestar02.webhop.org/ ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Convert/use GIS coordinates
On Wed, Jun 25, 2008 at 12:41 PM, Jean-Sébastien Guay [EMAIL PROTECTED] wrote: Hi Glenn, Bottom line: if you use VPB to build a terrain in UTM zone 32 (or whatever), you will need to do no coordinate conversion. I'm currently doing some tests with some data I got from http://www.ngdc.noaa.gov/mgg/image/2minrelief.html (pretty low res, but I'm just testing). The problem I have is that the data's positions seem to be in latitude/longitude in degrees, and I'd like to convert it to what I'm expecting (meters). I'm not very familiar with the tools (I assume GDAL and/or PROJ can do this), so I'd appreciate a hand :-) gdalinfo gives me this for the file I have: Driver: EHdr/ESRI .hdr Labelled Files: Hellobob_5209.bin Hellobob_5209.hdr Size is 271, 241 Coordinate System is `' Origin = (2.9833500,64.01666586493) Pixel Size = (0.0333000,-0.0333000) Corner Coordinates: Upper Left ( 2.983, 64.0166659) Lower Left ( 2.983, 55.983) Upper Right ( 12.0166658, 64.0166659) Lower Right ( 12.0166658, 55.983) Center ( 7.496, 59.996) Band 1 Block=271x1 Type=Byte, ColorInterp=Undefined NoData Value=99 So as you can see, ~(3, 56) to ~(12,64) in degrees. I'd like to have that in meters in the right place on the Earth... How would I do that? On the gdal_translate man page I see the option a_srs overrides the projection of the output file, but I have no idea what the argument should be. Thanks in advance, J-S J-S, From the looks of your coordinates, UTM Zone 40N would be a good choice for a projected SRS. The -a_srs argument will accept many things including PROJ4, WKT, or a file containing a WKT. Try this: gdal_translate -a_srs +proj=utm +zone=40 +datum=WGS84 infile outfile Let me know if that works. -gw -- Glenn Waldron : Pelican Mapping : http://pelicanmapping.com : 703-652-4791 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Convert/use GIS coordinates
Hi Glenn, From the looks of your coordinates, UTM Zone 40N would be a good choice for a projected SRS. It should actually be UTM zone 32V, unless I made a mistake somewhere. It's the tip of the Norwegian peninsula. The -a_srs argument will accept many things including PROJ4, WKT, or a file containing a WKT. Try this: gdal_translate -a_srs +proj=utm +zone=40 +datum=WGS84 infile outfile I tried that, using 32 instead of 40. gdal_translate -a_srs +proj=utm +zone=32 +datum=WGS84 32V.tif 32V_wgs84.tif It doesn't seem to change much, the model generated by vpb and then loaded still seems to be using the latitude/longitude in degrees as units (it's about 9 units by 8 units in size). I'm using this command to generate the model: osgdem -d 32V_wgs84.tif --POLYGONAL --LOD -v 0.0001 -l 8 -o database/32V_wgs84.osg gdalinfo on the new file gives: Driver: GTiff/GeoTIFF Files: 32V_wgs84.tif Size is 271, 241 Coordinate System is: PROJCS[unnamed, 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]], PROJECTION[Transverse_Mercator], PARAMETER[latitude_of_origin,0], PARAMETER[central_meridian,9], PARAMETER[scale_factor,0.9996], PARAMETER[false_easting,50], PARAMETER[false_northing,0], UNIT[metre,1, AUTHORITY[EPSG,9001]], AUTHORITY[EPSG,32632]] Origin = (2.9833500,64.01666586493) Pixel Size = (0.0333000,-0.0333000) Metadata: AREA_OR_POINT=Area Image Structure Metadata: INTERLEAVE=BAND Corner Coordinates: Upper Left ( 2.983, 64.0166659) ( 4d30'40.62E, 0d 0'2.08N) Lower Left ( 2.983, 55.983) ( 4d30'40.62E, 0d 0'1.82N) Upper Right ( 12.0166658, 64.0166659) ( 4d30'40.91E, 0d 0'2.08N) Lower Right ( 12.0166658, 55.983) ( 4d30'40.91E, 0d 0'1.82N) Center ( 7.496, 59.996) ( 4d30'40.76E, 0d 0'1.95N) Band 1 Block=271x15 Type=Int16, ColorInterp=Gray NoData Value=-32768 Help? :-) J-S -- __ Jean-Sebastien Guay[EMAIL PROTECTED] http://www.cm-labs.com/ http://whitestar02.webhop.org/ ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Convert/use GIS coordinates
On Wed, Jun 25, 2008 at 2:09 PM, Jean-Sébastien Guay [EMAIL PROTECTED] wrote: Hi Glenn, From the looks of your coordinates, UTM Zone 40N would be a good choice for a projected SRS. It should actually be UTM zone 32V, unless I made a mistake somewhere. It's the tip of the Norwegian peninsula. The -a_srs argument will accept many things including PROJ4, WKT, or a file containing a WKT. Try this: gdal_translate -a_srs +proj=utm +zone=40 +datum=WGS84 infile outfile I tried that, using 32 instead of 40. gdal_translate -a_srs +proj=utm +zone=32 +datum=WGS84 32V.tif 32V_wgs84.tif It doesn't seem to change much, the model generated by vpb and then loaded still seems to be using the latitude/longitude in degrees as units (it's about 9 units by 8 units in size). I'm using this command to generate the model: osgdem -d 32V_wgs84.tif --POLYGONAL --LOD -v 0.0001 -l 8 -o database/32V_wgs84.osg gdalinfo on the new file gives: Driver: GTiff/GeoTIFF Files: 32V_wgs84.tif Size is 271, 241 Coordinate System is: PROJCS[unnamed, 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]], PROJECTION[Transverse_Mercator], PARAMETER[latitude_of_origin,0], PARAMETER[central_meridian,9], PARAMETER[scale_factor,0.9996], PARAMETER[false_easting,50], PARAMETER[false_northing,0], UNIT[metre,1, AUTHORITY[EPSG,9001]], AUTHORITY[EPSG,32632]] Origin = (2.9833500,64.01666586493) Pixel Size = (0.0333000,-0.0333000) Metadata: AREA_OR_POINT=Area Image Structure Metadata: INTERLEAVE=BAND Corner Coordinates: Upper Left ( 2.983, 64.0166659) ( 4d30'40.62E, 0d 0'2.08N) Lower Left ( 2.983, 55.983) ( 4d30'40.62E, 0d 0'1.82N) Upper Right ( 12.0166658, 64.0166659) ( 4d30'40.91E, 0d 0'2.08N) Lower Right ( 12.0166658, 55.983) ( 4d30'40.91E, 0d 0'1.82N) Center ( 7.496, 59.996) ( 4d30'40.76E, 0d 0'1.95N) Band 1 Block=271x15 Type=Int16, ColorInterp=Gray NoData Value=-32768 Help? :-) Sorry I had my lat and long reversed ;) Anyway, the new SRS looks right, what does the .osg file say? The CoordinateSystemNode WKT? Sounds like a tiny file, can you attach it? -- Glenn Waldron : Pelican Mapping : http://pelicanmapping.com : 703-652-4791 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Convert/use GIS coordinates
J-S, Also, I am an idiot, because I meant to say gdalwarp, not gdal_translate. gdal_translate -a_srs will just assign an SRS, not reproject the data. Anyway I will take it offline with you. Glenn On Wed, Jun 25, 2008 at 2:26 PM, Glenn Waldron [EMAIL PROTECTED] wrote: On Wed, Jun 25, 2008 at 2:09 PM, Jean-Sébastien Guay [EMAIL PROTECTED] wrote: Hi Glenn, From the looks of your coordinates, UTM Zone 40N would be a good choice for a projected SRS. It should actually be UTM zone 32V, unless I made a mistake somewhere. It's the tip of the Norwegian peninsula. The -a_srs argument will accept many things including PROJ4, WKT, or a file containing a WKT. Try this: gdal_translate -a_srs +proj=utm +zone=40 +datum=WGS84 infile outfile I tried that, using 32 instead of 40. gdal_translate -a_srs +proj=utm +zone=32 +datum=WGS84 32V.tif 32V_wgs84.tif It doesn't seem to change much, the model generated by vpb and then loaded still seems to be using the latitude/longitude in degrees as units (it's about 9 units by 8 units in size). I'm using this command to generate the model: osgdem -d 32V_wgs84.tif --POLYGONAL --LOD -v 0.0001 -l 8 -o database/32V_wgs84.osg gdalinfo on the new file gives: Driver: GTiff/GeoTIFF Files: 32V_wgs84.tif Size is 271, 241 Coordinate System is: PROJCS[unnamed, 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]], PROJECTION[Transverse_Mercator], PARAMETER[latitude_of_origin,0], PARAMETER[central_meridian,9], PARAMETER[scale_factor,0.9996], PARAMETER[false_easting,50], PARAMETER[false_northing,0], UNIT[metre,1, AUTHORITY[EPSG,9001]], AUTHORITY[EPSG,32632]] Origin = (2.9833500,64.01666586493) Pixel Size = (0.0333000,-0.0333000) Metadata: AREA_OR_POINT=Area Image Structure Metadata: INTERLEAVE=BAND Corner Coordinates: Upper Left ( 2.983, 64.0166659) ( 4d30'40.62E, 0d 0'2.08N) Lower Left ( 2.983, 55.983) ( 4d30'40.62E, 0d 0'1.82N) Upper Right ( 12.0166658, 64.0166659) ( 4d30'40.91E, 0d 0'2.08N) Lower Right ( 12.0166658, 55.983) ( 4d30'40.91E, 0d 0'1.82N) Center ( 7.496, 59.996) ( 4d30'40.76E, 0d 0'1.95N) Band 1 Block=271x15 Type=Int16, ColorInterp=Gray NoData Value=-32768 Help? :-) Sorry I had my lat and long reversed ;) Anyway, the new SRS looks right, what does the .osg file say? The CoordinateSystemNode WKT? Sounds like a tiny file, can you attach it? -- Glenn Waldron : Pelican Mapping : http://pelicanmapping.com : 703-652-4791 -- Glenn Waldron : Pelican Mapping : http://pelicanmapping.com : 703-652-4791 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Convert/use GIS coordinates
Hi Glenn, Also, I am an idiot, because I meant to say gdalwarp, not gdal_translate. gdal_translate -a_srs will just assign an SRS, not reproject the data. gdalwarp asks me for -s_srs and -t_srs, if I just specify -t_srs +proj=utm +zone=32 +datum=WGS84 it says that there is no source coordinate system and aborts... What should I specify as the source coordinate system? Thanks, J-S -- __ Jean-Sebastien Guay[EMAIL PROTECTED] http://www.cm-labs.com/ http://whitestar02.webhop.org/ ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Convert/use GIS coordinates
Jean-Sébastien Guay writes: gdalwarp asks me for -s_srs and -t_srs, if I just specify -t_srs +proj=utm +zone=32 +datum=WGS84 it says that there is no source coordinate system and aborts... What should I specify as the source coordinate system? -s_srs EPSG:4326 Or the convenient shorthand -s_srs WGS84 See -a_srs discussion here http://gdal.org/gdal_utilities.html A handy site http://www.spatialreference.org/ref/epsg/4326/ Norman ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Convert/use GIS coordinates
Hi Norman, What should I specify as the source coordinate system? -s_srs EPSG:4326 Or the convenient shorthand -s_srs WGS84 Hmm, that doesn't seem to work either: gdalwarp -s_srs WGS84 -t_srs +proj=utm +zone=32 +datum=WGS84 32V.tif 32V_warped.tif Then I generate a terrain from that: osgdem -d 32V_warped.tif --TERRAIN -v 0.0001 -l 8 -o database_osg/32V.osg And if I load it, it's still the same as it was (i.e. too small relative to other models modeled in meters). gdalinfo output looks the same as before: Driver: GTiff/GeoTIFF Files: 32V_warped.tif Size is 271, 241 Coordinate System is: PROJCS[unnamed, 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]], PROJECTION[Transverse_Mercator], PARAMETER[latitude_of_origin,0], PARAMETER[central_meridian,9], PARAMETER[scale_factor,0.9996], PARAMETER[false_easting,50], PARAMETER[false_northing,0], UNIT[metre,1, AUTHORITY[EPSG,9001]], AUTHORITY[EPSG,32632]] Origin = (2.9833500,64.01666586493) Pixel Size = (0.0333000,-0.0333000) Metadata: AREA_OR_POINT=Area Image Structure Metadata: INTERLEAVE=BAND Corner Coordinates: Upper Left ( 2.983, 64.0166659) ( 4d30'40.62E, 0d 0'2.08N) Lower Left ( 2.983, 55.983) ( 4d30'40.62E, 0d 0'1.82N) Upper Right ( 12.0166658, 64.0166659) ( 4d30'40.91E, 0d 0'2.08N) Lower Right ( 12.0166658, 55.983) ( 4d30'40.91E, 0d 0'1.82N) Center ( 7.496, 59.996) ( 4d30'40.76E, 0d 0'1.95N) Band 1 Block=271x15 Type=Int16, ColorInterp=Gray Thanks for the links, BTW. J-S -- __ Jean-Sebastien Guay[EMAIL PROTECTED] http://www.cm-labs.com/ http://whitestar02.webhop.org/ ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Convert/use GIS coordinates
J-S, Send me the TIFF and I will figure out what the deal is. Just email it direct. -gw On Wed, Jun 25, 2008 at 4:36 PM, Jean-Sébastien Guay [EMAIL PROTECTED] wrote: Hi Norman, What should I specify as the source coordinate system? -s_srs EPSG:4326 Or the convenient shorthand -s_srs WGS84 Hmm, that doesn't seem to work either: gdalwarp -s_srs WGS84 -t_srs +proj=utm +zone=32 +datum=WGS84 32V.tif 32V_warped.tif Then I generate a terrain from that: osgdem -d 32V_warped.tif --TERRAIN -v 0.0001 -l 8 -o database_osg/32V.osg And if I load it, it's still the same as it was (i.e. too small relative to other models modeled in meters). gdalinfo output looks the same as before: Driver: GTiff/GeoTIFF Files: 32V_warped.tif Size is 271, 241 Coordinate System is: PROJCS[unnamed, 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]], PROJECTION[Transverse_Mercator], PARAMETER[latitude_of_origin,0], PARAMETER[central_meridian,9], PARAMETER[scale_factor,0.9996], PARAMETER[false_easting,50], PARAMETER[false_northing,0], UNIT[metre,1, AUTHORITY[EPSG,9001]], AUTHORITY[EPSG,32632]] Origin = (2.9833500,64.01666586493) Pixel Size = (0.0333000,-0.0333000) Metadata: AREA_OR_POINT=Area Image Structure Metadata: INTERLEAVE=BAND Corner Coordinates: Upper Left ( 2.983, 64.0166659) ( 4d30'40.62E, 0d 0'2.08N) Lower Left ( 2.983, 55.983) ( 4d30'40.62E, 0d 0'1.82N) Upper Right ( 12.0166658, 64.0166659) ( 4d30'40.91E, 0d 0'2.08N) Lower Right ( 12.0166658, 55.983) ( 4d30'40.91E, 0d 0'1.82N) Center ( 7.496, 59.996) ( 4d30'40.76E, 0d 0'1.95N) Band 1 Block=271x15 Type=Int16, ColorInterp=Gray Thanks for the links, BTW. J-S -- __ Jean-Sebastien Guay[EMAIL PROTECTED] http://www.cm-labs.com/ http://whitestar02.webhop.org/ ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org -- Glenn Waldron : Pelican Mapping : http://pelicanmapping.com : 703-652-4791 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Convert/use GIS coordinates
This site used to have / link to some useful info and software: http://www3.sympatico.ca/craymer/geodesy/geodesy.html I think GSRUG used to be available as a source download but may not be now. However, see the following: http://www.geod.nrcan.gc.ca/tools-outils/gsrug_e.php Alan Harris McGlone, James C. wrote: In one of the subprojects of our current project, we get some coordinates for objects from a network feed, in UTM projected using ED50 based on international 1924 spheroid, on zone 32. We'd need to use those to position objects in a given world space, and I was wondering if there was a general way to convert such values to something that we can use in OSG. this transformation is supported by PROJ4, for discrete coordinates, and by gdal (gdalwarp) for raster data using PROJ4. both are available at maptools.org I suspect values such as Easting and Northing are not really linear, since they map to a sphere UTM zones are 6 degrees on longitude wide, with the design goal being a scale error of 1 part in 1 at the edges. Depending on how big your area is, I doubt that the non-linearity of the projection will be an issue. If you're combining this with other data and want to be precise, you should determine the geographic datum (and vertical datum) of the other data sets. The most common these days is WGS84, used for GPS, with elevations referenced to the ellipsoid or to the geoid. chris ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Convert/use GIS coordinates
Hi J-S, As Chris mentioned, PROJ4 is the definitive toolkit for coordinate conversions. In addition: OGR (http://www.gdal.org/ogr) has an easier-to-use wrapper around PROJ4's capabilities (http://www.gdal.org/ogr/classOGRSpatialReference.html) which is handy because it can read OSG WKT projection definitions, which are the most common way to describe spatial reference systems. osgGIS (http://osggis.org) has yet another convenience layer on top of OGR that incorporates support for a couple things like geocentric data and local-origin matrices. Anyway the first task is to figure out whether you need to reproject your data at all. UTM is a flat-earth XYZ system. Do you have a terrain? What spatial reference system is it in? Glenn On Tue, Jun 10, 2008 at 4:21 PM, Jean-Sébastien Guay [EMAIL PROTECTED] wrote: Hi fellow OSGers, I was wondering if I could ask some questions about GIS in general on this list. I know there are some really knowledgeable people on this list (Glenn, I'm looking at you!). We have no one here who has any expertise in this subject... :-) In one of the subprojects of our current project, we get some coordinates for objects from a network feed, in UTM projected using ED50 based on international 1924 spheroid, on zone 32. We'd need to use those to position objects in a given world space, and I was wondering if there was a general way to convert such values to something that we can use in OSG. I suspect values such as Easting and Northing are not really linear, since they map to a sphere (note that as I said, I'm a total newbie to this). Also, the coordinate standard used could potentially change in mid-project, which is why I'd like a general way. Can GDAL do this? Can osgGIS? Would that be the way you would recommend doing it? For now we just need conversion of coordinates, but eventually we could need more, so if using osgGIS in our project would scale well, we'll possibly do that. Thanks in advance, J-S -- __ Jean-Sebastien Guay[EMAIL PROTECTED] http://www.cm-labs.com/ http://whitestar02.webhop.org/ ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org -- Glenn Waldron : Pelican Mapping : http://pelicanmapping.com : 703-652-4791 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Convert/use GIS coordinates
Hi Glenn, Thanks for the links, combined with Chris and Alan's links I might get a better understanding of the general terminology and concepts... That's one thing I'm lacking now, it just sounds like a bunch of acronyms and alien words to me :-) I thought being in computer science I'd be immune to acronymitis by now... Anyway the first task is to figure out whether you need to reproject your data at all. UTM is a flat-earth XYZ system. Do you have a terrain? What spatial reference system is it in? We /will/ have a terrain, but I don't have details on it. If it's also in UTM, we could use it directly and just not reproject anything, right? So you're saying we could just, for example, decide that our world origin is at some translation from the UTM coordinates' origin, and then translate all the data we get by that, and be done with it? For example, from the specs document I've got, it seems the coordinates we might get would look like 576120.324, 6224420.858, -102.73 What units would that be in? Our models are modeled in meters, and we'd like to use meters as world-units, so for distances to look right would we need to scale the terrain and the position data we get? Still a bit of confusion about the basic concepts. I'll go read those links now :-) J-S -- __ Jean-Sebastien Guay[EMAIL PROTECTED] http://www.cm-labs.com/ http://whitestar02.webhop.org/ ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Convert/use GIS coordinates
Hi again, For example, from the specs document I've got, it seems the coordinates we might get would look like 576120.324, 6224420.858, -102.73 I forgot to mention, what we have about the Z coordinate in the spec is: GPS-Z, positive going up towards the sky, which can be above sea level, zero is LAT (lowest astronomical tide), negative is going down towards the seabed, which could be subsea How do I interpret that? What I want is a position to place the object in 3D space. I assume the seabed (terrain) will be positioned correctly... And where do I put the ocean surface? Z=0 sounds like it could be incorrect (by the presence of conditional verbs in that sentence). Sounds like a very basic question, sorry about that. J-S -- __ Jean-Sebastien Guay[EMAIL PROTECTED] http://www.cm-labs.com/ http://whitestar02.webhop.org/ ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Convert/use GIS coordinates
j-s, this looks like it addresses your problem. i didn't read it ;) http://nauticalcharts.noaa.gov/csdl/Vdatum_pubs/UShydro2003.4a_1.pdf brian [EMAIL PROTECTED] wrote: - To: OpenSceneGraph Users osg-users@lists.openscenegraph.org From: Jean-Sébastien Guay [EMAIL PROTECTED] Sent by: [EMAIL PROTECTED] Date: 06/11/2008 09:22AM Subject: Re: [osg-users] Convert/use GIS coordinates Hi again, For example, from the specs document I've got, it seems the coordinates we might get would look like 576120.324, 6224420.858, -102.73 I forgot to mention, what we have about the Z coordinate in the spec is: GPS-Z, positive going up towards the sky, which can be above sea level, zero is LAT (lowest astronomical tide), negative is going down towards the seabed, which could be subsea How do I interpret that? What I want is a position to place the object in 3D space. I assume the seabed (terrain) will be positioned correctly... And where do I put the ocean surface? Z=0 sounds like it could be incorrect (by the presence of conditional verbs in that sentence). Sounds like a very basic question, sorry about that. J-S -- __ Jean-Sebastien Guay[EMAIL PROTECTED] http://www.cm-labs.com/ http://whitestar02.webhop.org/ ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org This is a PRIVATE message. If you are not the intended recipient, please delete without copying and kindly advise us by e-mail of the mistake in delivery. NOTE: Regardless of content, this e-mail shall not operate to bind CSC to any order or other contract unless pursuant to explicit written agreement or government initiative expressly permitting the use of e-mail for such purpose. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Convert/use GIS coordinates
On Wed, Jun 11, 2008 at 9:12 AM, Jean-Sébastien Guay [EMAIL PROTECTED] wrote: Hi Glenn, Thanks for the links, combined with Chris and Alan's links I might get a better understanding of the general terminology and concepts... That's one thing I'm lacking now, it just sounds like a bunch of acronyms and alien words to me :-) I thought being in computer science I'd be immune to acronymitis by now... Anyway the first task is to figure out whether you need to reproject your data at all. UTM is a flat-earth XYZ system. Do you have a terrain? What spatial reference system is it in? We /will/ have a terrain, but I don't have details on it. If it's also in UTM, we could use it directly and just not reproject anything, right? Right. So you're saying we could just, for example, decide that our world origin is at some translation from the UTM coordinates' origin, and then translate all the data we get by that, and be done with it? Right. Or better yet, use a MatrixTransform to place your terrain at actual UTM coordinates, and theyn you don't even have to translate the incoming data. For example, from the specs document I've got, it seems the coordinates we might get would look like 576120.324, 6224420.858, -102.73 What units would that be in? Our models are modeled in meters, and we'd like to use meters as world-units, so for distances to look right would we need to scale the terrain and the position data we get? UTM coordinates are in meters. X is relative to the central meridan of the UTM zone, plus the false easting, which exists only to avoid the use of negative numbers. Y is relative to the equator. Y values in the southern hemisphere are also given a false northing to avoid negative #s. Still a bit of confusion about the basic concepts. I'll go read those links now :-) Bottom line: if you use VPB to build a terrain in UTM zone 32 (or whatever), you will need to do no coordinate conversion. J-S -- __ Jean-Sebastien Guay[EMAIL PROTECTED] http://www.cm-labs.com/ http://whitestar02.webhop.org/ ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org -- Glenn Waldron : Pelican Mapping : http://pelicanmapping.com : 703-652-4791 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Convert/use GIS coordinates
Jean-Sébastien Guay writes: For example, from the specs document I've got, it seems the coordinates we might get would look like 576120.324, 6224420.858, -102.73 I forgot to mention, what we have about the Z coordinate in the spec is: GPS-Z, positive going up towards the sky, which can be above sea level, zero is LAT (lowest astronomical tide), negative is going down towards the seabed, which could be subsea How do I interpret that? What I want is a position to place the object in 3D space. I assume the seabed (terrain) will be positioned correctly... And where do I put the ocean surface? Z=0 sounds like it could be incorrect (by the presence of conditional verbs in that sentence). Sounds like a very basic question, sorry about that. Basic question yes Simple answer maybe It depends whether you want visualization or operational accuracy From http://en.wikipedia.org/wiki/Geoid Note that a GPS receiver on a ship may, during the course of a long voyage, indicate height variations, even though the ship will always be at sea level. This is because GPS satellites, orbiting about the center of gravity of the Earth, can only measure heights relative to a geocentric reference ellipsoid. To obtain one's geoidal height, a raw GPS reading must be corrected. Conversely, height determined by spirit leveling from a tidal measurement station, as in traditional land surveying, will always be geoidal height. See Google(GPS WGS-84) Google(WGS-84 ellipsoidal height) Here is a recent paper http://www.ngs.noaa.gov/PUBS_LIB/NGSRealTimeUserGuidelines.v2.0.2.pdf shameless plug ossimPlanet built on top of OSG uses a geoid corrected ellipsoid / Norman ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Convert/use GIS coordinates
This has a good description of UTM coordinates http://ergodd.zoo.ox.ac.uk/eden/etc/helpfiles/EDENHELPGPS.pdf Alan Harris Glenn Waldron wrote: On Wed, Jun 11, 2008 at 9:12 AM, Jean-Sébastien Guay [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] wrote: Hi Glenn, Thanks for the links, combined with Chris and Alan's links I might get a better understanding of the general terminology and concepts... That's one thing I'm lacking now, it just sounds like a bunch of acronyms and alien words to me :-) I thought being in computer science I'd be immune to acronymitis by now... Anyway the first task is to figure out whether you need to reproject your data at all. UTM is a flat-earth XYZ system. Do you have a terrain? What spatial reference system is it in? We /will/ have a terrain, but I don't have details on it. If it's also in UTM, we could use it directly and just not reproject anything, right? Right. So you're saying we could just, for example, decide that our world origin is at some translation from the UTM coordinates' origin, and then translate all the data we get by that, and be done with it? Right. Or better yet, use a MatrixTransform to place your terrain at actual UTM coordinates, and theyn you don't even have to translate the incoming data. For example, from the specs document I've got, it seems the coordinates we might get would look like 576120.324, 6224420.858, -102.73 What units would that be in? Our models are modeled in meters, and we'd like to use meters as world-units, so for distances to look right would we need to scale the terrain and the position data we get? UTM coordinates are in meters. X is relative to the central meridan of the UTM zone, plus the false easting, which exists only to avoid the use of negative numbers. Y is relative to the equator. Y values in the southern hemisphere are also given a false northing to avoid negative #s. Still a bit of confusion about the basic concepts. I'll go read those links now :-) Bottom line: if you use VPB to build a terrain in UTM zone 32 (or whatever), you will need to do no coordinate conversion. J-S -- __ Jean-Sebastien Guay[EMAIL PROTECTED] mailto:[EMAIL PROTECTED] http://www.cm-labs.com/ http://whitestar02.webhop.org/ ___ osg-users mailing list osg-users@lists.openscenegraph.org mailto:osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org -- Glenn Waldron : Pelican Mapping : http://pelicanmapping.com : 703-652-4791 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Convert/use GIS coordinates
In one of the subprojects of our current project, we get some coordinates for objects from a network feed, in UTM projected using ED50 based on international 1924 spheroid, on zone 32. We'd need to use those to position objects in a given world space, and I was wondering if there was a general way to convert such values to something that we can use in OSG. this transformation is supported by PROJ4, for discrete coordinates, and by gdal (gdalwarp) for raster data using PROJ4. both are available at maptools.org I suspect values such as Easting and Northing are not really linear, since they map to a sphere UTM zones are 6 degrees on longitude wide, with the design goal being a scale error of 1 part in 1 at the edges. Depending on how big your area is, I doubt that the non-linearity of the projection will be an issue. If you're combining this with other data and want to be precise, you should determine the geographic datum (and vertical datum) of the other data sets. The most common these days is WGS84, used for GPS, with elevations referenced to the ellipsoid or to the geoid. chris winmail.dat___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org