[gdal-dev] Question about gdal2wktraster
Jorge Arévalo
jorge.arevalo at gmail.com
Sun Jul 12 19:01:28 EDT 2009
Hello,
Context: GDAL WKT Raster driver
I've loaded the tif image
ftp://ftp.remotesensing.org/geotiff/samples/gdal_eg/cea.tif on PostGIS
using gdal2wktraster script using this line: gdal2wktraster.py -r
cea.tif -t usa_mountain_one_band -s 4267 -b 1 -k 514x15 -I -M -o
usa_raster_one_band.sql
I used the srid 4267 because the information given for "gdalinfo
cea.tif" (Maybe it is my error).
The problem is: If I execute gdalinfo over the table created in
PostGIS using my driver, I get this:
(...)
GEOGCS["NAD27",
DATUM["North_American_Datum_1927",
SPHEROID["Clarke 1866",6378206.4,294.9786982138982,
AUTHORITY["EPSG","7008"]],
AUTHORITY["EPSG","6267"]],
PRIMEM["Greenwich",0,
AUTHORITY["EPSG","8901"]],
UNIT["degree",0.01745329251994328,
AUTHORITY["EPSG","9122"]],
AUTHORITY["EPSG","4267"]]
(...)
Corner Coordinates:
Upper Left ( -28493.168, 4224973.000) (Invalid angle,Invalid angle)
Lower Left ( -28493.168, 4194061.600) (Invalid angle,Invalid angle)
Upper Right ( 2358.210, 4224973.000) (Invalid angle,Invalid angle)
Lower Right ( 2358.210, 4194061.600) (Invalid angle,Invalid angle)
Center ( -13067.479, 4209517.300) (Invalid angle,Invalid angle)
(...)
Look at "Invalid angle error". If I execute gdalinfo over the tif
image, I get this:
(...)
PROJCS["unnamed",
GEOGCS["NAD27",
DATUM["North_American_Datum_1927",
SPHEROID["Clarke 1866",6378206.4,294.9786982138982,
AUTHORITY["EPSG","7008"]],
AUTHORITY["EPSG","6267"]],
PRIMEM["Greenwich",0],
UNIT["degree",0.0174532925199433],
AUTHORITY["EPSG","4267"]],
PROJECTION["Cylindrical_Equal_Area"],
PARAMETER["standard_parallel_1",33.75],
PARAMETER["central_meridian",-117.333333333333],
PARAMETER["false_easting",0],
PARAMETER["false_northing",0],
UNIT["metre",1,
AUTHORITY["EPSG","9001"]]]
(...)
Corner Coordinates:
Upper Left ( -28493.167, 4255884.544) (117d38'28.21"W, 33d54'13.08"N)
Lower Left ( -28493.167, 4224973.143) (117d38'28.21"W, 33d37'30.66"N)
Upper Right ( 2358.212, 4255884.544) (117d18'28.28"W, 33d54'13.08"N)
Lower Right ( 2358.212, 4224973.143) (117d18'28.28"W, 33d37'30.66"N)
Center ( -13067.478, 4240428.844) (117d28'28.24"W, 33d45'51.47"N)
(...)
The important thing is the "UNIT["metre",1,AUTHORITY["EPSG","9001"]]]
part of the string that doesn't appear in my driver. For this reason,
the transformation between utm (the original coords of the tif image)
and lat,long doesn't take place. Then, the UTM coordinates are
considered as invalid angles, of course.
I think that my great mistake, as I said, was to choose 4267 as srid
(I wasn't sure). Am I right? If yes, What srid should I use? If not,
maybe the error is in my driver's code...
Many thanks in advance
Best regards,
Jorge
More information about the gdal-dev
mailing list