[gdal-dev] pdf file - raster and vector differences

Even Rouault even.rouault at spatialys.com
Mon Feb 8 00:54:22 PST 2016


Le dimanche 07 février 2016 23:08:29, Piotr Pachół a écrit :
> Hello,
> 
> Some types of vector pdf files are not recognizeable by ogrinfo command.
> For instance pdf made by Acrobat Distiller. For example file:
> https://en.wikipedia.org/wiki/File:APISmap1.pdf
> So is it possible by means of gdal tools to recognize that pdf like that
> is vectorial ?

Piotr,

Quoting the doc http://gdal.org/frmt_pdf.html, the PDF driver can """read 
vector features encoded according to PDF's logical structure facilities (as 
described by "§10.6 - Logical Structure" of PDF spec 
http://www.adobe.com/devnet/acrobat/pdfs/pdf_reference_1-7.pdf), or retrieve 
only vector geometries for other vector PDF files."""
Actually looking closer, the current code is a bit more restrictive than the 
above sentence, and apparently it doesn't read that file since it has no 
explicit layer in it. I don't recall if it is for a fundamental reason or not. 
Anyway the best you'd get is non georeferenced vector features, as this PDF 
file doesn't use any geospatial registration mechanism.

Even

> 
> Regards,
> Piotr
> 
> W dniu 2016-02-02 o 18:35, Andre Joost pisze:
> > Am 02.02.2016 um 15:37 schrieb Piotr Pachół:
> >> Hello,
> >> 
> >> I would like to ask If there is a way (by means of gdal tools) to
> >> recognize that pdf has vector features ?
> >> I have hundreds of geospatial pdf files (raster and vector) and I don't
> >> want  to open each of file in Acrobat Reader to verify if it is raster
> >> or vector.
> >> Instead I would like to make a script to produce result in text files,
> >> which I can later process automatically.
> >> I must add that in standard result of gdalinfo command I can't see any
> >> difference between raster and vector pdf file.
> > 
> > Apart from gdalinfo you can run ogrinfo on the files, which will only
> > return vector layers.
> > 
> > See my answer here for an example:
> > 
> > http://gis.stackexchange.com/questions/156299/how-to-have-gdal-print-laye
> > rs-of-geopdf-and-say-which-are-raster-vs-vector
> > 
> > 
> > gdalinfo also reports meta layers, which only consist of sublayers
> > (vector or raster or both), without own data.
> > 
> > HTH,
> > André Joost
> 
> _______________________________________________
> gdal-dev mailing list
> gdal-dev at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/gdal-dev

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


More information about the gdal-dev mailing list