Friday 18 September 2015

qgis - Cropping and transforming geoPDF with GDALwarp


I got some great advice on how to transform a geoPDF to a geoTIF at Historical U.S.G.S. Georeferencing, which used the available downloads from this site. I would like to take it a little further and not only convert, but remove the border of historical USGS maps in order to be able to tile them in QGIS. Being a basic GIS user, I get lost in the "coding" involved to implement these practices.



How can I convert and crop historical USGS maps so they can be tiled in QGIS?




I am attempting to do this again, it has been a while. I made it through the steps and I get a cropped quad that has back areas along the edges. I don't believe this happened when I did this in the past.


enter image description here



Answer



Here are the steps how I managed to clip your Geopdf from the last question:



  • Read the imprinted border coordinates clockwise from the map and put them into a text file like this:




Nr;WKT
1;POLYGON((-74.25 41.75, -74.0 41.75, -74.0 41.5, -74.25 41.5, -74.25 41.75))



  • Load the text file as text delimited file, with ; as delimiter and NAD27 EPSG:4267 as CRS. The polygon should match with the map canvas, leaving out the border.




  • Save the polygon into the same CRS as the tif file. This is a poly projection, and you find it in the user defined CRS list. Add the shapefile to the canvas.






`+proj=poly +lat_0=41.5 +lon_0=-74.125 +x_0=0 +y_0=0 +ellps=clrk66 +nadgrids=@conus,@alaska,@ntv2_0.gsb,@ntv1_can.dat +units=m +no_defs`


  • Clip the tif on the polygon file with Raster -> Extraction -> Clipper


The command line should look something like



`gdalwarp -q -cutline D:/Karten/shp/Länder/USA/Newburg-border.shp -crop_to_cutline -of GTiff D:/Karten/gdal/gdalwarp/Newburg.tif D:/Karten/shp/Länder/USA/Newburg-clip`


This is what I got: enter image description here


No comments:

Post a Comment

arcpy - Changing output name when exporting data driven pages to JPG?

Is there a way to save the output JPG, changing the output file name to the page name, instead of page number? I mean changing the script fo...