Version 3 (modified by dac, 7 years ago) (diff)

--

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?

A:
This 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.

We'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/).

If 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:

python 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

or if you have a WKT file you can use:

python assign_projection.py --wkt ogcwkt.wkt *mapped*.bil

Note the use of wild characters '*' to assign the projection to multiple files at once.

The 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.

Back to FAQ