[gdal-dev] GeoPDF content inverted as GeoTIF

Even Rouault even.rouault at spatialys.com
Mon Dec 14 05:50:01 PST 2015


Le lundi 14 décembre 2015 13:25:13, Rahkonen Jukka (MML) a écrit :
> Hi,
> 
> There is something odd in the PDF. It is without coordinate system and
> perhaps because of that the top-left coordinates are (0,0) and north
> coordinate is increasing from top to bottom. Probably the "Invalid length
> for GPTS object" error does not have any effect on this.

It does have an effect. The error messages indicates that the geospatial tags 
are ignored, thus the non-georeferenced coordinates which are displayed.

I've looked at that file a bit and the georeferencing is unusual. It uses Adobe 
ISO 32000 georeferencing but with only 2 tie-points instead of 4 as usual. The 
spec doesn't mention the number of tie-points, but the driver assumes 4, based 
on test samples. It has also unusual MediaBox coordinates (non 0 lower left 
corner)
I've removed locally the limitation and did some fiddling in the code to 
generalize it, but I don't manage to get a good overlay with a basemap. I can 
get something roughly in the target area, but there is a rotation term that is 
clearly missing. But with only 2 tiepoints, the solver of GCPs to geotransform 
cannot produce any rotation term and assumes linear stretching of coordinates. 
You have to make assumptions as you've the 6 coefficients of the geotransform 
matrix to compute, but only 4 equations. In that case, to recover rotation 
terms, it would probably have to make the assumption that the pixels are 
square instead (you'd have only 4 unknowns: x,y of top-left corner, pixel 
size, rotation angle). I didn't investigate further for now. But it seems 
unwise from the data producer to produce only 2 tiepoints because of the above 
mentionned ambiguity. As far as I can see, the PDF spec doesn't tell what to 
do in that case.

Even

-- 
Spatialys - Geospatial professional services
http://www.spatialys.com


More information about the gdal-dev mailing list