roblabs / gdal-geopdf

Processing GeoPDFs using GDAL
MIT License
11 stars 1 forks source link

2018 USGS Geospatial PDF produces `ERROR 1: insufficient arguments for Marked Content` #3

Open roblabs opened 5 years ago

roblabs commented 5 years ago

Issue

When processing the 2018 Geospatial PDFs from the nationalMap.gov an error occurs that was not seen when processing the same quadrangle from 2015. Posting this issue in case someone else has any research into what the problem may be.

Steps to reproduce

2015 GeospatialPDF

# wget
wget 
https://prd-tnm.s3.amazonaws.com/StagedProducts/Maps/USTopo/PDF/CA/CA_Descanso_20150223_TM_geo.pdf

#gdal
gdal_translate CA_Descanso_20150223_TM_geo.pdf CA_Descanso_20150223_TM_geo.tif -co COMPRESS=LZW --config GDAL_PDF_DPI 200

2018 GeospatialPDF

# wget 
wget 
https://prd-tnm.s3.amazonaws.com/StagedProducts/Maps/USTopo/PDF/CA/CA_Descanso_20180904_TM_geo.pdf

#gdal
gdal_translate CA_Descanso_20180904_TM_geo.pdf CA_Descanso_20180904_TM_geo.tif -co COMPRESS=LZW --config GDAL_PDF_DPI 200

# Errors many times; similar to this
ERROR 1: Pos = 47918296, insufficient arguments for Marked Content
ERROR 1: Pos = 47918296, insufficient arguments for Marked Content
ERROR 1: Pos = 47918317, insufficient arguments for Marked Content
ERROR 1: Pos = 47918327, insufficient arguments for Marked Content
ERROR 1: Pos = 47918327, insufficient arguments for Marked Content
ERROR 1: Pos = 47918329, insufficient arguments for Marked Content
ERROR 1: Pos = 47918334, insufficient arguments for Marked Content
ERROR 1: Pos = 47918334, insufficient arguments for Marked Content
ERROR 1: Pos = 47918334, insufficient arguments for Marked Content
ERROR 1: Pos = 47918339, insufficient arguments for Marked Content
ERROR 1: Pos = 47918343, insufficient arguments for Marked Content
ERROR 1: Pos = 47920226, insufficient arguments for Marked Content
ERROR 1: Pos = 47920231, insufficient arguments for Marked Content
ERROR 1: Pos = 47920268, insufficient arguments for Marked Content
ERROR 1: Pos = 47920268, insufficient arguments for Marked Content
ERROR 1: Pos = 47920271, insufficient arguments for Marked Content
ERROR 1: Pos = 47946009, insufficient arguments for Marked Content
ERROR 1: Pos = 47946015, insufficient arguments for Marked Content
ERROR 1: Pos = 47947917, insufficient arguments for Marked Content
ERROR 1: Pos = 47954326, insufficient arguments for Marked Content
jamesecox50 commented 4 years ago

I have the same issue with the new maps while doing gdal_translate

roblabs commented 4 years ago

@jamesecox50 — This has also been posted to https://gis.stackexchange.com/questions/309193

From StackExchange, I also posted this:

_I should note: there is no problem with gdal_translate, but an extra noisy ERROR that wasn't in previous versions of the GeospatialPDF_

For the time being, I have been writing stderr out to tmp/ folder

jamesecox50 commented 4 years ago

Thanks for the update "For the time being, I have been writing stderr out to tmp/ folder" Im not familiar with stderr to a folder location, I will investigate. https://topomerge.com/

roblabs commented 4 years ago

This is a sample command to avoid the spurious errors by redirecting standard error to a file.

gdal_translate "CA_O'Neals_20180829_geo.pdf" out.tif 2>> tmp/error.txt
jamesecox50 commented 4 years ago

Thanks, I use the > for creating final status files, was not aware errors could off loaded, ThankYou!