[gdal-dev] Re: Testing Geospatial PDF support
Brent Fraser
bfraser at geoanalytic.com
Tue Oct 19 16:54:28 EDT 2010
Evan,
For the original PDF, gdalinfo shows:
Driver: PDF/Geospatial PDF
Files: my.pdf
Size is 7487, 5229
Coordinate System is:
PROJCS["WGS_1984_UTM_Zone_35N",
GEOGCS["GCS_WGS_1984",
DATUM["WGS_1984",
SPHEROID["WGS_1984",6378137.0,298.257223563]],
PRIMEM["Greenwich",0.0],
UNIT["Degree",0.0174532925199433]],
PROJECTION["Transverse_Mercator"],
PARAMETER["False_Easting",500000.0],
PARAMETER["False_Northing",0.0],
PARAMETER["Central_Meridian",27.0],
PARAMETER["Scale_Factor",0.9996],
PARAMETER["Latitude_Of_Origin",0.0],
UNIT["Meter",1.0]]
GeoTransform =
208685.3477667082, 91.60344342730002, -9.686865691546485e-005
4840743.141406364, -0.0003005644555746527, -103.1065102766238
Corner Coordinates:
Upper Left ( 208685.348, 4840743.141) ( 23d23'13.21"E, 43d39'45.29"N)
Lower Left ( 208684.841, 4301599.199) ( 23d38'41.63"E, 38d48'54.07"N)
Upper Right ( 894520.329, 4840740.891) ( 31d53'20.40"E, 43d36'54.07"N)
Lower Right ( 894519.822, 4301596.949) ( 31d32'26.52"E, 38d46'29.57"N)
Center ( 551602.585, 4571170.045) ( 27d36'58.63"E, 41d17'25.18"N)
Band 1 Block=7487x1 Type=Byte, ColorInterp=Red
Band 2 Block=7487x1 Type=Byte, ColorInterp=Green
Band 3 Block=7487x1 Type=Byte, ColorInterp=Blue
and the resulting Geotiff is:
Driver: GTiff/GeoTIFF
Files: my.tif
Size is 7487, 5229
Coordinate System is:
PROJCS["WGS 84 / UTM zone 35N",
GEOGCS["WGS 84",
DATUM["WGS_1984",
SPHEROID["WGS 84",6378137,298.257223563,
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",27],
PARAMETER["scale_factor",0.9996],
PARAMETER["false_easting",500000],
PARAMETER["false_northing",0],
UNIT["metre",1,
AUTHORITY["EPSG","9001"]],
AUTHORITY["EPSG","32635"]]
GeoTransform =
208685.3477667082, 91.60344342730002, -9.686865691546485e-005
4840743.141406364, -0.0003005644555746527, -103.1065102766238
Metadata:
AREA_OR_POINT=Area
Image Structure Metadata:
INTERLEAVE=PIXEL
Corner Coordinates:
Upper Left ( 208685.348, 4840743.141) ( 23d23'13.21"E, 43d39'45.29"N)
Lower Left ( 208684.841, 4301599.199) ( 23d38'41.63"E, 38d48'54.07"N)
Upper Right ( 894520.329, 4840740.891) ( 31d53'20.40"E, 43d36'54.07"N)
Lower Right ( 894519.822, 4301596.949) ( 31d32'26.52"E, 38d46'29.57"N)
Center ( 551602.585, 4571170.045) ( 27d36'58.63"E, 41d17'25.18"N)
Band 1 Block=7487x1 Type=Byte, ColorInterp=Red
Band 2 Block=7487x1 Type=Byte, ColorInterp=Green
Band 3 Block=7487x1 Type=Byte, ColorInterp=Blue
After gdalwarp:
Driver: GTiff/GeoTIFF
Files: gdalwarp.tif
Size is 7179, 5644
Coordinate System is:
PROJCS["WGS 84 / UTM zone 35N",
GEOGCS["WGS 84",
DATUM["WGS_1984",
SPHEROID["WGS 84",6378137,298.257223563,
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",27],
PARAMETER["scale_factor",0.9996],
PARAMETER["false_easting",500000],
PARAMETER["false_northing",0],
UNIT["metre",1,
AUTHORITY["EPSG","9001"]],
AUTHORITY["EPSG","32635"]]
Origin = (208684.841232902890000,4840743.141386642100000)
Pixel Size = (95.527649479168488,-95.527649479168488)
Metadata:
AREA_OR_POINT=Area
Image Structure Metadata:
INTERLEAVE=PIXEL
Corner Coordinates:
Upper Left ( 208684.841, 4840743.141) ( 23d23'13.19"E, 43d39'45.29"N)
Lower Left ( 208684.841, 4301585.088) ( 23d38'41.65"E, 38d48'53.62"N)
Upper Right ( 894477.837, 4840743.141) ( 31d53'18.52"E, 43d36'54.23"N)
Lower Right ( 894477.837, 4301585.088) ( 31d32'24.76"E, 38d46'29.25"N)
Center ( 551581.339, 4571164.115) ( 27d36'57.71"E, 41d17'24.99"N)
Band 1 Block=7179x1 Type=Byte, ColorInterp=Red
Band 2 Block=7179x1 Type=Byte, ColorInterp=Green
Band 3 Block=7179x1 Type=Byte, ColorInterp=Blue
Doing the math on a 1:75k map, at 150 dpi the pixel size should be about
12.7 meters.
Brent
On 10/19/2010 12:45 PM, Even Rouault wrote:
> Brent,
>
> I'm not sure what you find is wrong. What does gdalinfo returns ?
>
> The PDF driver will reproject the coordinates of the GPTS array from
> geographic into UTM 35N and try to build a geotransform matrix from that. The
> matrix may have rotating terms, so you likely need to use gdalwarp afterwards
> to make it look "straight". However I'm not 100% sure this is the correct way
> to interpret the the Adobe style georeferencing, but I didn't find a better one
> up to know. So if you or someone else have any clue...
>
> Most geospatial PDFs I've found in the wild (such as the one of cantopo) seem
> to use the OGC Best Practice encoding.
>
> Even
>
> Le mardi 19 octobre 2010 20:11:13, Brent Fraser a écrit :
>> Even,
>>
>>
>> I've tested a couple of Geospatial PDFs with the code that's in GDAL
>> trunk.
>>
>> The Canadian topos work well (e.g.
>> ftp://ftp2.cits.rncan.gc.ca/pub/cantopo/50k_geopdf/085/b/cantopo_085b14_geo
>> pdf.zip). They were produced using ESRI ArcMap 9.2.6.1500. I get a
>> properly geo-referenced GeoTiff after running gdal_translate.
>>
>> I have another PDF produced by ArcMap10.0.0.2414. It has a main map
>> and a keymap. The strange thing is that even though the coordinate
>> system is UTM Zone 35 , it has a transformation matrix with geographic
>> coordinates given. Here's a portion of the "dump" file:
>>
>> Item[4] : VP
>> Type = array
>> Item[0]:
>> Type = dictionary
>> Item[0] : Name = ÿþI (string)
>> Item[1] : Measure
>> Type = dictionary
>> Item[0] : Subtype = GEO (name)
>> Item[1] : LPTS
>> Type = array
>> Item[0]: 0 (int)
>> Item[1]: 1 (int)
>> Item[2]: 0 (int)
>> Item[3]: 0 (int)
>> Item[4]: 1 (int)
>> Item[5]: 0 (int)
>> Item[6]: 1 (int)
>> Item[7]: 1 (int)
>> Item[2] : GPTS
>> Type = array
>> Item[0]: 38.815000 (real)
>> Item[1]: 23.644900 (real)
>> Item[2]: 43.662600 (real)
>> Item[3]: 23.387000 (real)
>> Item[4]: 43.615000 (real)
>> Item[5]: 31.889000 (real)
>> Item[6]: 38.774900 (real)
>> Item[7]: 31.540700 (real)
>> Item[3] : GCS
>> Type = dictionary
>> Item[0] : WKT =
>> PROJCS["WGS_1984_UTM_Zone_35N",GEOGCS["GCS_WGS_1984",DATUM["D_WGS_1984",SPH
>> EROID["WGS_1984",6378137.0,298.257223563]],PRIMEM["Greenwich",0.0],UNIT["De
>> gree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["Fal
>> se_Easting",500000.0],PARAMETER["False_Northing",0.0],PARAMETER["Central_Me
>> ridian",27.0],PARAMETER["Scale_Factor",0.9996],PARAMETER["Latitude_Of_Origi
>> n",0.0],UNIT["Meter",1.0]] (string)
>> Item[1] : Type = PROJCS (name)
>> Item[4] : Type = Measure (name)
>> Item[5] : Bounds
>> Type = array
>> Item[0]: 0 (int)
>> Item[1]: 1 (int)
>> Item[2]: 0 (int)
>> Item[3]: 0 (int)
>> Item[4]: 1 (int)
>> Item[5]: 0 (int)
>> Item[6]: 1 (int)
>> Item[7]: 1 (int)
>> Item[2] : Type = Viewport (name)
>> Item[3] : BBox
>> Type = array
>> Item[0]: 3168 (int)
>> Item[1]: 2433 (int)
>> Item[2]: 3557 (int)
>> Item[3]: 2127 (int)
>> Item[1]:
>> Type = dictionary
>> Item[0] : Name = ÿþA (string)
>> Item[1] : Measure
>> Type = dictionary
>> Item[0] : Subtype = GEO (name)
>> Item[1] : LPTS
>> Type = array
>> Item[0]: 0 (int)
>> Item[1]: 1 (int)
>> Item[2]: 0 (int)
>> Item[3]: 0 (int)
>> Item[4]: 1 (int)
>> Item[5]: 0 (int)
>> Item[6]: 1 (int)
>> Item[7]: 1 (int)
>> Item[2] : GPTS
>> Type = array
>> Item[0]: 40.190600 (real)
>> Item[1]: 26.279300 (real)
>> Item[2]: 40.767200 (real)
>> Item[3]: 26.273100 (real)
>> Item[4]: 40.769300 (real)
>> Item[5]: 27.212000 (real)
>> Item[6]: 40.192600 (real)
>> Item[7]: 27.210200 (real)
>> Item[3] : GCS
>> Type = dictionary
>> Item[0] : WKT =
>> PROJCS["WGS_1984_UTM_Zone_35N",GEOGCS["GCS_WGS_1984",DATUM["D_WGS_1984",SPH
>> EROID["WGS_1984",6378137.0,298.257223563]],PRIMEM["Greenwich",0.0],UNIT["De
>> gree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["Fal
>> se_Easting",500000.0],PARAMETER["False_Northing",0.0],PARAMETER["Central_Me
>> ridian",27.0],PARAMETER["Scale_Factor",0.9996],PARAMETER["Latitude_Of_Origi
>> n",0.0],UNIT["Meter",1.0]] (string)
>> Item[1] : Type = PROJCS (name)
>> Item[4] : Type = Measure (name)
>> Item[5] : Bounds
>> Type = array
>> Item[0]: 0 (int)
>> Item[1]: 1 (int)
>> Item[2]: 0 (int)
>> Item[3]: 0 (int)
>> Item[4]: 1 (int)
>> Item[5]: 0 (int)
>> Item[6]: 1 (int)
>> Item[7]: 1 (int)
>> Item[2] : Type = Viewport (name)
>> Item[3] : BBox
>> Type = array
>> Item[0]: 57 (int)
>> Item[1]: 2465 (int)
>> Item[2]: 3052 (int)
>> Item[3]: 46 (int)
>>
>> ------------------------
>>
>> The resulting GeoTiff has a scaling problem, I suspect related to the
>> transformation matrix.
>>
>> Any thoughts on that?
>>
>> Thanks!
>> Brent Fraser
More information about the gdal-dev
mailing list