[gdal-dev] Some info about geospatial PDF and TerraGo Toolbar

George Demmy gdemmy at gmail.com
Fri Mar 2 16:14:33 EST 2012


On Fri, Mar 2, 2012 at 9:02 PM, Even Rouault
<even.rouault at mines-paris.org> wrote:
> Le vendredi 02 mars 2012 21:22:10, George Demmy a écrit :
>> Here's some info that might help the development effort for PDF and
>> use of PDF created or georegistered by GDAL.
>>
>> Something that is confusing is TerraGo Toolbar's behavior with PDF
>> files not created by TerraGo software. The company policy was to not
>> support files with the Toolbar, the reason being the company could not
>> afford to support debugging of files created by other software
>> systems, etc., with a free product. This policy was imperfectly
>> implemented in Toolbar code: sometimes it can be tricked into
>> believing a PDF was created by TerraGo even when it wasn't.
>
> Well, sorry for trolling a bit, but I can't resist ;-)

No problem!

> I'm not surprised such
> attempt wasn't reliable (and having even tried to do so is quite chocking from
> my point of view !). How would that be doable with an opened spec ? Unless
> there are some secret sauce not exposed in the spec, such as strict order of
> keys in the dictionary...

Nothing that tricky... just signatures. From a spec perspective,
everything is disclosed.

>> Some of
>> the "works sometimes, other times not" behavior can be attributed to
>> this, especially when it comes to ISO encodings which have been
>> supported since 2008.
>
> Hum, actually, I've never see any public sample with the ISO encoding (but to
> be honest, I couldn't find many of them) that is recognized by the toolbar
> (well, the SRS and geotransform are recognized, but none of the tools are
> available, not even coordinate display)

There are a bunch of them out there, but they are scattered. I
actually don't know of a good spot to get a bunch of different
ISO-encoded g-PDFs. Esri ArcGIS can only create ISO. TerraGo, like
GDAL, writes either at the user's preference. There are some other
geospatial PDF writers out there and they split between ISO and OGC.
This really is begging for standardization...

>> With the OGC encoding, it's safer to always write the numbers as
>> strings .16g.
>
> That's what the driver does, unless it detects its an int value, in that case
> it is written as a standard PDF numeric value. Saves a few bytes ;-)

Nice!

>> However, the ISO method does not permit this. The ISO
>> method is less sensitive to the limitations of the PDF real number
>> object type, so the only concern there is precision (PDF reals are ~ 5
>> significant digits in the fractional part (cf. ISO32000)), which
>> cannot be addressed without modifying the encoding specification and
>> everything that implies.
>
> Actually, the driver will try to output up to 16 decimals. I'm not sure if it
> will cause issues to readers. I guess that, at worst, they will discard the
> extra digits.

Yup.

>> When did gdal_translate pick up the cool macho supremo ability to
>> georegister a PDF? The googles did not help me...
>
> Just a few days ago. And for the record, MapServer can also now output
> geospatial PDF, through its Cairo/PDF backend, when it leverages the GDAL PDF
> driver.

Thanks for the heads up!

Cheers!

George Demmy


More information about the gdal-dev mailing list