[gdal-dev] creation of Geospatial PDF

Even Rouault even.rouault at mines-paris.org
Fri Jul 25 07:24:40 PDT 2014


Selon Luca Delucchi <lucadeluge at gmail.com>:

> On 25 July 2014 15:23, Even Rouault <even.rouault at mines-paris.org> wrote:
> >
> >> Hi all,
> >>
> >> I would like to create a Geospatial PDF with several vectors, is it
> possible?
> >
> > That should be possible yes.
> >
> >>
> >> I tried with ogr2ogr but it failed,
> >
> > How ?
> >
>
> - first attempt
>
> ogr2ogr -f PDF trentino.pdf zps_trento.shp grafo.shp
> FAILURE: Couldn't fetch requested layer 'grafo.shp'!

That's an invalid syntax for ogr2ogr. Only accept one only datasource.
In your example you could just move the 2 shapefiles into a new directory
"blabla"

and then

ogr2ogr -f PDF trentino.pdf blabla


Another (more complicated) option would be to use a OGR VRT that would reference
to your various input layers.

>
> - second attempt
>
> ogr2ogr -f PDF trentino.pdf zps_trento.shp
> ogr2ogr -f PDF -update trentino.pdf grafo.GeoJSON

Yes, the PDF driver doesn't support update/append mode.

>
> - third attempt
>
> ogr2ogr -f PDF trentino.pdf zps_trento.GeoJSON -lco
> OGR_DATASOURCE=grafo.GeoJSON

OGR_DATASOURCE not supported in the OGR driver, only the raster driver

>
> >  reading the documentation I found
> >> EXTRA_RASTERS to add several raster but not EXTRA_VECTORS. There is
> >> OGR_DATASOURCE but the documentation say that it is used "to display
> >> on top of the raster layer", and it doesn't work with OGR.
> >
> > Which version of GDAL are you using ?
>
> 1.11
>
> > - If trunk, the relevant doc is : http://gdal.org/frmt_pdf.html
> > - If 1.11 or older, http://gdal.org/1.11/frmt_pdf.html and
> > http://gdal.org/1.11/ogr/drv_pdf.html
> >
> > But in both cases, ogr2ogr -f PDF the.pdf input_datasource should work
> >
>
> yes if I use only one vector datasource yes,but I'm not able to put
> more then one vector in only one PDF
>
> Thanks
>
> --
> ciao
> Luca
>
> http://gis.cri.fmach.it/delucchi/
> www.lucadelu.org
>








More information about the gdal-dev mailing list