[MapServer-users] Switch custom projection from PROJ 7 to PROJ 9 (from flat epsg file to aux database)
Michal Seidl
michal.seidl at gmail.com
Mon Jul 13 14:30:41 PDT 2026
Hello,
after long time with no problems I have probelm with custom EPSG code
definition in new Debian 13 Mapserver instataltion.
- Firstly it looks like Mpaserver version 8.4 does not work without
/etc/mapserver.conf file but there is no defualt version installed by
package. One have to create new one manually?
- With old Mapserver 7.6 and PROJ 7.2 I have just added PROJ_LIB <path
to dir with epsg file> and edited text file to add any code EPSG:xxx
ESRI:xxx and everuthing worked fine
- with new Mapserver 8.4 and PROJ 9.1 I have to created
/etc/mapserver.conf file and added this content to file to point to
system PROJ proj.db datbase file location and my aux.db database with
custom CRS
CONFIG
ENV
PROJ_DATA "/usr/share/proj"
PROJ_AUX_DB "/etc/proj/aux.db"
END
END
I have created aux.db with these command:
$ sudo projinfo EPSG:5514 --output-id ESRI:102067 --dump-db-structure |
sudo sqlite3 /etc/proj/aux.db
$ sudo projinfo EPSG:5514 --output-id EPSG:102067 -o SQL -q | sudo
sqlite3 /etc/proj/aux.db
I have tested it from command line with:
$ projinfo EPSG:102067 -o PROJ
PROJ.4 string:
+proj=krovak +lat_0=49.5 +lon_0=24.8333333333333 +alpha=30.2881397527778
+k=0.9999 +x_0=0 +y_0=0 +ellps=bessel +towgs84=589,76,480,0,0,0,0
+units=m +no_defs +type=crs
$ projinfo ESRI:102067 -o PROJ
Warning: object is deprecated
Alternative non-deprecated CRS:
EPSG:5514
PROJ.4 string:
+proj=krovak +lat_0=49.5 +lon_0=24.8333333333333 +alpha=30.2881397527778
+k=0.9999 +x_0=0 +y_0=0 +ellps=bessel +towgs84=589,76,480,0,0,0,0
+units=m +no_defs +type=crs
But when I tried to use them in mapfile like this:
WEB
METADATA
"ows_title" "WFS/WMS VFK MapServer Project 5127"
"ows_enable_request" "*"
"ows_srs" "EPSG:5514 ESRI:102067 EPSG:102067"
"ows_onlineresource" "('https://shkn.gisa.cz/shkn-mapserver/',)?"
END
END
PROJECTION
"ESRI:102067"
END
everything is OK and I get image from URL request.
But if I change
PROJECTION
"ESRI:102067"
END
to
PROJECTION
"EPSG:102067"
END
I got error directly in browser:
msProcessProjection(): Projection library error. PROJ error "Unknown
error (code 4096)" when instantiating "EPSG:102067"
Also If I use ESRI:102067 in URL I got XML file error:
<?xml version='1.0' encoding="UTF-8" standalone="no" ?>
<!DOCTYPE ServiceExceptionReport SYSTEM
"http://schemas.opengis.net/wms/1.1.1/exception_1_1_1.dtd">
<ServiceExceptionReport version="1.1.1">
<ServiceException>
msProcessProjection(): Projection library error. PROJ error
"Invalid value for an argument" when instantiating
"init=ESRI:102067"
</ServiceException>
</ServiceExceptionReport>
Any idea what can be wrong? PROJ_DEBUG "ON" does not show many details :(
Thanks Michal S.
More information about the MapServer-users
mailing list