[gdal-dev] Extracting vector layers from Geospatial PDF

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

[gdal-dev] Extracting vector layers from Geospatial PDF

Rajesvari Parasa
Hi,

This must be a redundant question but I really haven't figured out a way to do this. I can export into a tiff but that's not desirable.

I am using gdal 2.5 and built it from source and enabled poppler. But when I use ogrinfo to read the file, I get 'unable to read the data source with available drivers'. On looking up online, one much suggested solution was to try: ogr2ogr -f sqlite out.sqlite in.pdf
But since ogr doesn't recognize my PDF, I can't use this.

Can someone please help?

Regards,
Rajeswari

_______________________________________________
gdal-dev mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/gdal-dev
Reply | Threaded
Open this post in threaded view
|

Re: Extracting vector layers from Geospatial PDF

Tobias Wendorff
Hi there,

Am Mi, 6.02.2019, 17:58 schrieb Rajesvari Parasa:
> to try: ogr2ogr -f sqlite out.sqlite in.pdf
> But since ogr doesn't recognize my PDF, I can't use this.

I had to use "--config OGR_PDF_READ_NON_STRUCTURED YES" to make it
read my PDFs, but I think, this will destroy your Geospatial content.

I've just read it in non-structured and georeferenced it using
ground control points:

ogr2ogr -progress -a_srs EPSG:3857 -gcp ... output.geojson input.pdf
--config OGR_PDF_READ_NON_STRUCTURED YES -NLT polygon

Perhaps this helps :/

Best regards,
Tobias

_______________________________________________
gdal-dev mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/gdal-dev
Reply | Threaded
Open this post in threaded view
|

Re: Extracting vector layers from Geospatial PDF

Michael Patrick
> This must be a redundant question but I really haven't figured out a way to do this. I can export into a tiff but that's not desirable.

There are a variety of potential difficulties that can make this problematic.
1. PDF Version and compliance of the PDF file itself.
2. The lineage of the generating application and 'print' tool chain.

In desperation, at times I've had to open the PDF in Adobe Illustrator or Inkscape, and export the geometries, and then transform them appropriately.

_______________________________________________
gdal-dev mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/gdal-dev
Reply | Threaded
Open this post in threaded view
|

Re: Extracting vector layers from Geospatial PDF

Rajesvari Parasa
In reply to this post by Tobias Wendorff
Hi Tobias,

Thank you for suggesting this. I used the config option and my geospatial content was intact. Here's the command:
ogrinfo ELU_PD_08_03.pdf --config OGR_PDF_READ_NON_STRUCTURED YES

it lists all relevant layers. Copy the name of the layer (say "Layername") you want to write in shapefile and then: 

ogr2ogr –f “ESRI Shapefile” footprint.shp ELU_PD_08_03.pdf Layername --config OGR_PDF_READ_NON_STRUCTURED YES


I didn't know that ogrinfo takes config options. This is quite interesting because the document of ogrinfo doesn't mention this.

Thanks again!


On Thu, Feb 7, 2019 at 1:20 AM Tobias Wendorff <[hidden email]> wrote:
Hi there,

Am Mi, 6.02.2019, 17:58 schrieb Rajesvari Parasa:
> to try: ogr2ogr -f sqlite out.sqlite in.pdf
> But since ogr doesn't recognize my PDF, I can't use this.

I had to use "--config OGR_PDF_READ_NON_STRUCTURED YES" to make it
read my PDFs, but I think, this will destroy your Geospatial content.

I've just read it in non-structured and georeferenced it using
ground control points:

ogr2ogr -progress -a_srs EPSG:3857 -gcp ... output.geojson input.pdf
--config OGR_PDF_READ_NON_STRUCTURED YES -NLT polygon

Perhaps this helps :/

Best regards,
Tobias


_______________________________________________
gdal-dev mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/gdal-dev
Reply | Threaded
Open this post in threaded view
|

Re: Extracting vector layers from Geospatial PDF

Tobias Wendorff
Am Sa, 9.02.2019, 20:47 schrieb Rajesvari Parasa:
>
> I didn't know that *ogrinfo takes config options*. This is quite
> interesting because the document of ogrinfo doesn't mention this.

It does. Please also check this:
https://github.com/OSGeo/gdal/issues/1282

Did a huge test, since I'm also working with PDF files a lot ;)

_______________________________________________
gdal-dev mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/gdal-dev
Reply | Threaded
Open this post in threaded view
|

Re: Extracting vector layers from Geospatial PDF

Even Rouault-2
In reply to this post by Rajesvari Parasa
> I didn't know that *ogrinfo takes config options*. This is quite
> interesting because the document of ogrinfo doesn't mention this.

It is in the general section:

https://gdal.org/ogr_utilities.html


--
Spatialys - Geospatial professional services
http://www.spatialys.com
_______________________________________________
gdal-dev mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/gdal-dev
Reply | Threaded
Open this post in threaded view
|

Re: Extracting vector layers from Geospatial PDF

Rajesvari Parasa
Thanks for sharing this. I was looking just here: https://gdal.org/ogrinfo.html


On Sun, Feb 10, 2019 at 1:26 AM Even Rouault <[hidden email]> wrote:
> I didn't know that *ogrinfo takes config options*. This is quite
> interesting because the document of ogrinfo doesn't mention this.

It is in the general section:

https://gdal.org/ogr_utilities.html


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

_______________________________________________
gdal-dev mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/gdal-dev