Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

I have a PDF file (10mb) which contains a NEATLINE polygon in metadata.

$ gdalinfo I5601_GeoPDF.pdf

Driver: PDF/Geospatial PDF Files: I5601_GeoPDF.pdf Size is 5906, 3543 Coordinate System is: PROJCS["UTM Zone 56, Southern Hemisphere", GEOGCS["GDA94", ... GeoTransform = 128363.7573358897, 42.324133621968, 0.8865642156959999 6471730.899290663, 0.8865642156959999, -42.324133621968 Metadata: CREATION_DATE=D:20080515105609+10 CREATOR=BAE SYSTEMS MapMaker.exe 2.9.830.19227 NEATLINE=POLYGON ((191125.203093351592543 6340529.201165121048689,188350.332458852295531 6473000.141725543886423,378308.662319099530578 6476979.201503321528435,381083.532953590154648 6344508.260942890308797,191125.203093351592543 6340529.201165121048689)) ...

Now if I extract the NEATLINE data into a .cvs and use gdalwarp to cut it:

$ for i in *.pdf; do gdalinfo $i|grep NEATLINE | awk -F= '{print "id,WKT\n1,\"" $2 "\""}' > $i.csv; gdalwarp -crop_to_cutline -cutline $i.csv -overwrite $i $i.tif; done

I get a geotiff that isn't clipped correctly: picture of results

I've tried this on US 250k maps and it works. I'm wondering whether anybody can tell me if I'm doing something wrong, or is the metadata in the PDF wrong ?

share|improve this question
1  
You can quickly check the validity of the neatline metadata by creating a polygon with those coordinates and overlaying it with your pdf. If using QGIS, you can use the QuickQKT plugin to paste the wkt value and create a polygon layer. –  spatialthoughts Jun 12 '13 at 6:28
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.