[Proj] adding a local EPSG code

Frank Warmerdam warmerdam at pobox.com
Wed Dec 16 10:15:12 EST 2009


Hamish wrote:
> Hi there,
> 
> I am wondering, what's the recommended best-practice way to locally add a
> new EPSG code & have the proj4 toolchain pick it up?
> 
> do I just pick a suitable number and append it to the end of 
> /usr/share/proj/epsg? I'd prefer to add it to /usr/share/proj/other.extra,
> but how is that file used? does the code need to be in the file at proj4
> and gdal build-time in order to work?  (same Q for the fate of the esri &
> esri.extra files, out of curiosity)
> 
> fwiw I'm dealing with a nationally known handy-projection not a personal
> invention, but probably not up to the popularity that would warrant
> submission for official inclusion to whatever the EPSG call themselves
> these days. just another local tmerc, but one I'd like to have on all
> the local machines..

Hamish,

If you are using PROJ.4 from the commandline or from environments where
you can pass the PROJ.4 definition string then you can put the definition
in any of the init files and use a meaningful name.

For instance, if you added it at the end of other.extra with the name
hamish_cs then you could reference it as:

   +init=other.extra:hamish_cs

You generally only have to pretend it is an EPSG coordinate system if
you are using PROJ.4 through software that wants to refer to things by
EPSG number and which internally is creating the +init=epsg:n string.
This is the case with the WxS services in MapServer for instance.

The files like other.extra and esri.extra have non-epsg numeric codes
that are sometimes used as if they were epsg codes through WMS and related
software.  When you want to do that you need to manually append other.extra
and esri.extra to the epsg file.

I try to avoid distributing the epsg init file in adultered form as the
EPSG database terms of use discourage redistributing their database under
the name "epsg" if it is not representative of the coordinate system
and parameters as they originally provided them.

Best regards,
-- 
---------------------------------------+--------------------------------------
I set the clouds in motion - turn up   | Frank Warmerdam, warmerdam at pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush    | Geospatial Programmer for Rent



More information about the Proj mailing list