Changes between Initial Version and Version 1 of FAQ/aplunknownmapprojection


Ignore:
Timestamp:
Dec 4, 2014, 12:32:20 PM (10 years ago)
Author:
dac
Comment:

Added page with assign_projection script documentation

Legend:

Unmodified
Added
Removed
Modified
  • FAQ/aplunknownmapprojection

    v1 v1  
     1=== Q: I get the error "Unknown map projection: You will have to fill in the projection name and datum in the map info in the .hdr file yourself." when defining a projection using Proj4, what should I do? ===
     2
     3'''A:'''[[BR]]
     4This error is produced when using a projection defined using a Proj4 string that is not OSGB36 NG or UTM and APL doesn't know how to add it to the header file correctly.
     5
     6We've written a script which will add the projection information from a Proj4 string or WKT file (assign_projection.py) which is available on GitHub ([https://github.com/pmlrsg/arsf_tools/ https://github.com/pmlrsg/arsf_tools/]).
     7
     8If you copy the script to the same directory as your mapped files, open a command window and navigate to that directory you should be able to assign the correct projection to all your files using:
     9{{{
     10python assign_projection.py --proj4 "+proj=tmerc +lat_0=39.66825833333333 +lon_0=-8.133108333333334 +k=1 +x_0=0 +y_0=0 +ellps=GRS80 +units=m +no_defs" *mapped*.bil
     11}}}
     12
     13or if you have a WKT file you can use:
     14{{{
     15python assign_projection.py --wkt ogcwkt.wkt *mapped*.bil
     16}}}
     17
     18Note the use of wild characters '*' to assign the projection to multiple files at once.
     19
     20The tool requires GDAL to run, under Windows if you have QGIS or GRASS installed through OSGeo4W you need to run the tool from the OSGeo4W shell. Another option for installing the GDAL Python bindings is to install [http://conda.pydata.org/miniconda.html miniconda] and get GDAL through this using:
     21
     22{{{
     23conda install gdal
     24}}}
     25
     26If you're running OS X, GDAL is also available through conda. For Linux it is available through the package manager.