[gdal-dev] Removing layers from GeoSpatial PDF with ogr2ogr?

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

[gdal-dev] Removing layers from GeoSpatial PDF with ogr2ogr?

David Strip-2
I'm trying to remove a layer from a geospatial pdf (specifically the orthoimage layer in USGS topos). ogrinfo reports 26 layers in the meta-data report, but only 12 layers with vector features.
When I try to remove the image layer with this command
ogr2ogr -f "PDF" map.pdf NM_Canada_Ojitos_20110201_TM_geo_enabled.pdf --config GDAL_PDF_LAYERS_OFF "Images.Orthoimage"

the output file is missing the layers with the text labels. In addition, the styling of at least some of the layers is different. For example, the contours in the input have two different line weights, but the output is a single line weight.
Are these differences a limitation of the driver, or do I need to add more parameters/options?

gdal_translate creates an accurate representation in a pdf file, but the output is a bitmap within a pdf, not a layered vector file. ghostscript can be used to remove the image and maintain a vector file, but the layers are gone. And of course, the proprietary Adobe Acrobat can do the task.

 


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

Re: Removing layers from GeoSpatial PDF with ogr2ogr?

Even Rouault-2

On mercredi 25 avril 2018 12:06:17 CEST David Strip wrote:

> I'm trying to remove a layer from a geospatial pdf (specifically the

> orthoimage layer in USGS topos). ogrinfo reports 26 layers in the meta-data

> report, but only 12 layers with vector features. When I try to remove the

> image layer with this command

> ogr2ogr -f "PDF" map.pdf NM_Canada_Ojitos_20110201_TM_geo_enabled.pdf

> --config GDAL_PDF_LAYERS_OFF "Images.Orthoimage"

>

> the output file is missing the layers with the text labels. In addition, the

> styling of at least some of the layers is different. For example, the

> contours in the input have two different line weights, but the output is a

> single line weight. Are these differences a limitation of the driver, or do

> I need to add more parameters/options?

 

This is expected. When doing ogr2ogr you run into limitations of the read side and write side of the PDF driver, and running through OGR abstraction in the middle, so loss is expected in the case of PDF.

 

 

--

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: Removing layers from GeoSpatial PDF with ogr2ogr?

Tobias Wendorff
Am Mi, 25.04.2018, 21:02 schrieb Even Rouault:
>
> This is expected. When doing ogr2ogr you run into limitations
> of the read side and write side of the PDF driver, and running
> through OGR abstraction in the middle, so loss is expected in
> the case of PDF.

Even experienced PDF-orientated applications, like Ghostscript,
are have problems with PDF layers.

I had a similar problem in the past. I ended up unpacking the PDF
to an editable text-only format and removed the objects manually.

Maybe you can find someone with Acrobat PDF (the editor one), who
can fix the files for you?

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

Re: Removing layers from GeoSpatial PDF with ogr2ogr?

David Strip-2
On 4/26/2018 3:33 PM, Tobias Wendorff wrote:

> Am Mi, 25.04.2018, 21:02 schrieb Even Rouault:
>> This is expected. When doing ogr2ogr you run into limitations
>> of the read side and write side of the PDF driver, and running
>> through OGR abstraction in the middle, so loss is expected in
>> the case of PDF.
> Even experienced PDF-orientated applications, like Ghostscript,
> are have problems with PDF layers.
>
> I had a similar problem in the past. I ended up unpacking the PDF
> to an editable text-only format and removed the objects manually.
>
> Maybe you can find someone with Acrobat PDF (the editor one), who
> can fix the files for you?
>
>
I'm working with the "new" USGS topo maps which are distributed in
geospatial PDF format. I'm trying to remove the orthoimage layer. There
is a hack using ghostscript to remove all bitmaps that works for this
special case.
_______________________________________________
gdal-dev mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/gdal-dev