3

I'm trying to write a script that can automatically use GDAL to crop the informational border from the FAA's published sectional charts (GeoTIFF) found here:

I know that I can use gdal_translate -projwin ulx uly brx bry to crop it to a coordinate range, but I'm not sure where to get the values for the map area aside from by hand, or if there is possibly a better way to crop it.

Is the information necessary to crop the chart extractable from the files they provide?

6

You will find the borders in degrees in the enclosed html file. gdalinfo can give you the same values, but these are the corners of the tif including the legend, not the map canvas you are interested in. Unfortunately, the map is in a lcc projection, and thus the borders do not follow the exact degree of latitude and longitude, and are not even rectangular.

So you have to create a cutline shapefile using QGIS manually. The shapefile should have the same CRS as the tif file.

  • Load the tif file into QGIS. I took Albuquerque North as reference. A custom CRS will be created
  • Set the project CRS to that of the layer
  • Create a new polygon shapefile, choosing the custom CRS from the first step
  • Draw a polygon around the map content
  • Adjust the corners by zooming in if necessary
  • Use Raster -> Extraction -> Clipper to create a new tif file, with nodata set to 0, and the polygon shapefile as mask layer. The command line will look this way:
gdalwarp -dstnodata 0 -q -cutline D:/Karten/shp/Länder/USA/AlbuqN_extent.shp -crop_to_cutline -of GTiff "D:\\Karten\\shp\\Länder\\USA\\Albuquerque 92 North.tif" D:/Karten/shp/Länder/USA/AlbuqN.tif

You have to do that once for every map, and can then use gdalwarp with that commandline indepently from QGIS for future downloads of the same map.

  • The FAA has changed the format to some degree of the downloads with the new format being available in March. Sample File is Here Will this remove the need for the steps you describe in your answer or will it still be the same. – Mark Cupitt Mar 1 '14 at 10:47
  • Quote from FAA Web Site: Instead of using scanned chart images, the new d-VC is created directly from our digital files, resulting in a crisper and brighter image with improved georeferencing. – Mark Cupitt Mar 1 '14 at 10:53
  • 1
    I see no changes in format, so the steps will be the same. – AndreJ Mar 1 '14 at 12:36
  • Tried this, but get an error on the Clipper. Command is gdalwarp -dstnodata 0 -q -cutline "C:/test.shp" -crop_to_cutline -of GTiff "C:/test.tif" "C:test cut.tif" The Error is in python/plugins\raster_transparency\rastertransparency.py" TypeError: QSpinBox.setMinimum(int): argument 1 has unexpected type 'long' QGIS version: 2.1.0-Master Master, fa90fc9 - If I select create Output Alpha Band, then no error, but output is completely black. – Mark Cupitt Mar 4 '14 at 2:29
  • Never Mind, it failed on the old format files, but worked fine on the new format mentioned above in my comments. Will just wait until they issue. Thanks. – Mark Cupitt Mar 4 '14 at 2:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.