Personal tools
You are here: Home Documentation Errors msProcessProjection(): No such file or directory

msProcessProjection(): No such file or directory

Document Actions
Error displayed when trying to refer to an epsg file.

The message tells you that MapServer cannot find the epsg file.

On Windows, the default location of the epsg file is c:\proj\nad. MS4W users will find the epsg file in \ms4w\proj\nad.

Linux/Unix users should be careful to specify the correct case when referring to the epsg file, since filenames are case sensitive on Linux/Unix. "init=epsg:4326" refers to the epsg filename, and therefore "init=EPSG:4326" will not work because it will be looking for an EPSG file in uppercase.

Setting the location of the epsg file

There are a few options available if you need to set the epsg location:

  1. Use a system variable ("environment variable" on windows) called "PROJ_LIB" and point it to your epsg directory.

  2. Use the mapfile parameter CONFIG to force the location of the epsg file. This parameter is specified at the MAP level (see the mapfile reference):

    MAP 
      ...
      CONFIG "PROJ_LIB" "C:/somedir/proj/nad/"
      ...
    END
    
  3. Set an environment variable through your web server. Apache has a SetEnv directive that can set environment variables. Add something like the following to your Apache httpd.conf file:

    SetEnv PROJ_LIB C:/somedir/proj/nad/
    

This Error Reference applies to: MapServer 4.0, MapServer 4.2, MapServer 4.4, MapServer 4.6, MapServer 4.8

by Jeff McKenna last modified 2006-05-12 09:35

Another work around for this problem

Posted by Ben Madin at 2008-01-08 01:01
Don't use the init=epsg: approach, but use the proj4text string instead! This problem is about finding the list.

Having encountered this problem on a server where I wasn't able to alter environment variables and wasn't using a mapfile (it was just a coordinate converter), thanks to some help from the MapServer mailing list I realised that the problem I had was looking up the epsg file to convert from a srid to a proj4text string. As I already had the spatial_ref_sys table in the database, the easiest approach was a quick lookup query, and use the string. In PHP/Mapscript:

$q="SELECT proj4text FROM spatial_ref_sys WHERE srid = $to_proj";
$to_text = $db->getone($q) or die($db->errormsg(). "<br>in<pre>$q</pre>");
$projOutObj = ms_newprojectionobj($to_text);

Hope this helps someone!

Powered by Plone