Hi,
First, it is possible to tell Mapserver where to find the projection files in
the mapfile, in MAP section. Excerpt from
http://www.mapserver.org/mapfile/map.html
PROJ_LIB [path]
The CONFIG parameter can be used to define the location of your EPSG files for
the Proj.4 library. Setting the [key] to PROJ_LIB and the [value] to the
location of your EPSG files will force PROJ.4 to use this value. Using CONFIG
allows you to avoid setting environment variables to point to your PROJ_LIB
directory. Here are some examples:
Unix
CONFIG "PROJ_LIB" "/usr/local/share/proj/"
Second, Mapserver epsg file ships without Google projection. Without adding the
definition it is impossible to refer to epsg:900913 projection with the code
number. Have you added corresponding line to the epsg file, whitch is usually
in /usr/share/proj/epsg?
<900913> +proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0
+y_0=0 +k=1.0 +units=m +nadgri...@null +no_defs
Put it on the first line so Mapserver finds it immediately without a need to go
through the whole list.
-Jukka Rahkonen-
________________________________
Lähettäjä: [email protected]
[mailto:[email protected]] Puolesta Adrian Popa
Lähetetty: 13. lokakuuta 2009 10:55
Vastaanottaja: Lars Lingner
Kopio: [email protected]
Aihe: Re: [mapserver-users] msProcessProjection(): Projection library
error.no system list, errno: 13
Update:
I have symlinked the null file to epsg, and now strace shows that the
file is read, but I still get the same error when trying to call WMS GetMap...
:(
[r...@terra map]# ls -l /usr/share/proj/null
lrwxrwxrwx 1 root root 20 Oct 13 10:50 /usr/share/proj/null ->
/usr/share/proj/epsg
Adrian Popa wrote:
Thank you for your reply Lars, my info is inline.
Lars Lingner wrote:
Adrian Popa schrieb:
Hmm, any idea on this one? How can I find out
if proj is trying to read
the epsg file? I'm thinking of using strace to
see what files it tries
to open, but I don't know what syntax to use to
try to project from 4326
to 900913...
Just to clarify:
- Your data is in wgs84 (epsg:4326)
Yes
- you want to serve mercator projection (epsg:900913)
Yes (the frontend will be OpenLayers (through TileCache)
A few questions:
- are there any errors in the capabilities document?
No, it looks ok. I can post it if you want, but it's a bit
large. It outputs an XML which describes the layers, projections and some
settings from the map file. I haven't seen another working GetCapabilites file,
so I can't tell if it's missing something...
- did you tried to use mapserver logging (MS_ERRORFILE)
and high debug
level (DEBUG 5)
Here is the output after enabling MS_ERRORFILE and DEBUG 5 at
layer level and at map level:
[Tue Oct 13 10:36:36 2009].954434 msProcessProjection():
Projection library error. no system list, errno: 13
[Tue Oct 13 10:36:36 2009].954562 mapserv request processing
time (msLoadMap not incl.): 0.000s
[Tue Oct 13 10:36:36 2009].954584 msFreeMap(): freeing map at
0x8496ac8.
[Tue Oct 13 10:36:36 2009].954651 freeLayer(): freeing layer at
0x84a9378.
- could you try to use shp2img, maybe this gives you a
bit more information?
[r...@terra map]# shp2img -o /tmp/out.png -m
/var/www/html/map/rtc_base.map -e "20.259999999999998 43.16 29.700000000000003
49.2016" -s "1250 800" -l "GranitaJudete"
This works just fine (however it doesn't use WMS!). The image
displayed is correct (and it is projected in mercator projection!).
If I run:
[r...@terra map]# strace shp2img -o /tmp/out.png -m
/var/www/html/map/rtc_base.map -e "20.259999999999998 43.16 29.700000000000003
49.2016" -s "1250 800" -l "GranitaJudete" 2>&1 | grep epsg
.. I don't get any matches on the epsg file that is supposed to
be used by proj.
Looking through the output of strace, I can see it tries to
open some proj-related files...
open("/usr/share/proj/proj_def.dat", O_RDONLY) = -1 ENOENT (No
such file or directory)
open("/usr/share/proj/null", O_RDONLY) = -1 ENOENT (No such
file or directory)
I wonder why it tries to open a file called null - maybe an
error?
- did you compile MapServer and the dependencies by
yourself?
Yes. These are my configure arguments:
./configure --with-freetype --with-png --with-agg=../agg-2.5
--with-proj --with-ogr --with-gdal --with-xml2 --with-wfs --with-wcs \
--with-wmsclient --with-wfsclient --with-postgis --with-threads
--with-sos --with-mygis --with-geos --with-tiff
- what MapServer version do you use?
version 5.4.1
- do you have Proj4 installed? (OpenLayers doesn't use
the same lib, it
uses the javascript lib)
[adri...@terra mapserver]$ rpm -qa | grep proj
proj-devel-4.5.0-1.fc5
proj-4.5.0-1.fc5
I hope it does not look like keeping you busy, but
without further
information its difficult to help.
Your help is very much appreciated. Any idea is a good one
because it might get me out of this predicament. :)
Regards,
Adrian
P.S. If I understand how projections work - if I "call" the
projection with it's EPSG code it needs the epsg file to get the details about
the projection. In my layers I'm using the EPSG definition instead the EPSG
code to define my projections. If I switch to codes it won't work (I have tried
a few months ago). So, to me, it seems mapserver (or proj) can't get the
definitions from the epsg file (maybe because it searches for the wrong file).
I will try to create the file and try again. I'll let you know how it works.
Lars
_______________________________________________
mapserver-users mailing list
[email protected]
http://lists.osgeo.org/mailman/listinfo/mapserver-users
________________________________
_______________________________________________
mapserver-users mailing list
[email protected]
http://lists.osgeo.org/mailman/listinfo/mapserver-users
_______________________________________________
mapserver-users mailing list
[email protected]
http://lists.osgeo.org/mailman/listinfo/mapserver-users