6

I want to delete the orthoimage from a downloaded USGS geo.pdf so that I only have the topo. I run the following command

C:\OSGeo4W>gdal_translate "C:\Users\...\Blacksburg_geo.pdf" --config GDAL_PDF_LAYERS_OFF "Image" "C\Users\...\Blacksburg.pdf" 

It strips the orthoimage as desired, but renders a very poor quality topo map image. I'm not aware of any options to improve image quality.

0

1 Answer 1

10

gdal_translate is rasterizing the output, you can increase the quality of the raster output by increasing the DPI with a config or open option

--config GDAL_PDF_DPI=300 

or

-oo DPI=300 

E.g:

gdal_translate --config GDAL_PDF_DPI=300 --config GDAL_PDF_LAYERS_OFF "Image" Blacksburg_geo.pdf Blacksburg.pdf 

Default resolution:

enter image description here

300 DPI:

enter image description here

A couple of alternatives:

  • you can retain vector layers with ogr2ogr but you'll get much worse quality visually as the marginalia, symbology and drawing order gets messed up.

  • you can (depending on your PDF viewer) just open the layers side panel and turn the ortho off in the original PDF so it doesn't display, e.g:

enter image description here

enter image description here

2
  • Thanks. I am a newbie, it took a few tries to implement your command line, but I got it to work! Commented Jul 17 at 14:25
  • Sorry, I've added an example command for completeness now. Commented Jul 17 at 22:01

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.