[Proj] confused from krovak

Jachym Cepicky jachym.cepicky at centrum.cz
Wed Mar 15 18:08:54 EST 2006


Hallo, 
after successful compilation of proj on ms windows (thank you, Mateusz),
I try to get "expected" results from UMN MapServer.

My data are stored in Krovak projection (known as S-JTSK). All the data
are in "GIS version of Krovak", which means for the axes, that X=-y and
Y=-x. I used patch of PJ_krovak.c from Radim Blazek's site.

Output of cs2cs gives me expected result:

echo "-603056 -1.16353e+006" | cs2cs +proj=krovak +ellps=bessel +a=6377397.1550000003 +es=0.0066743722 +f=299.1528128000 +towgs84=570.8,85.7,462.8,4.998,1.587,5.261,3.56 +to +proj=latlong +datum=WGS84 +ellps=WGS84 +no_defs
16d32'43.318"E  49d9'55.923"N 44.706

this corresponds more or less with the output from GRASS GIS. Parameters
for projection informations are taken from PROJ_INFO file from my GRASS
locations.

Now I would like to share some data via UMN MapServer as WMS. What is
the right way, how to define the projection "krovak" in Mapfile when I
would like view the data also in other projections?

To use EPSG code seems not to be working -- Krovak is defined with

<2065> +proj=krovak +lat_0=49.5 +lon_0=60.16666666666667 +alpha=30.28813972222222 +k=0.9999 +x_0=0 +y_0=0 +ellps=bessel +pm=ferro +units=m +no_defs

and using this parameters with cs2cs gives

echo "-603056 -1.16353e+006" | cs2cs +proj=krovak +lat_0=49.5 +lon_0=60.16666666666667 +alpha=30.28813972222222 +k=0.9999 +x_0=0 +y_0=0 +ellps=bessel +pm=ferro +units=m +no_defs +to +proj=latlong +datum=WGS84 +ellps=WGS84 +no_defs
34d12'48.052"E  49d10'0.227"N -701.834

which is definitely bad result

So I have 
    
    EXTENT -603055.58 -1163534.63 -578334.19 -1138794.16
    WEB
        "wms_srs" "EPSG:4326"
    END
    PROJECTION
        "proj=krovak"
        "ellps=bessel"
        "a=6377397.155"
        "es=0.0066746722"
        "f=299.1528128"
        "towgs84=570.8,85.7,462.8,4.998,1.587,5.261,3.56"
    END
    
In my mapfile

However GetCapabilities gives me strange result:
     <LatLonBoundingBox minx="37.9432" miny="69.5973" maxx="38.6756" maxy="69.8515" />

Using GRASSs  g.region w=-603055.58 s=-1163534.63 e=-578334.19 n=-1138794.16 -gb

returns

n=-1138794.16
s=-1163534.63
w=-603055.58
e=-578334.19
nsres=4.96696848
ewres=4.96712678
rows=4981
cols=4977
LL_W=16.50846607
LL_E=16.88255667
LL_N=49.41034697
LL_S=49.16549325

So what to do? How to setup my mapfile correctly? Why is actualy version
of Krovak in EPSG as it is (2065)? I know lot of people and companyes, who are having their
maps in "Krovakgis" projection (-x,-y), but none, who is using some
S-JTSK - Ferro X,Y version. This significantly complicates usage of e.g.
grass, qgis and other programs.

Results can be viewed on 

GetCapabilities: http://indica.mendelu.cz/cgi-bin/mapserv.exe?map=c:\mapservdata\data\data_slp\krtiny.map&version=1.1.1&service=WMS&request=GetCapabilities
GetMap (default): http://indica.mendelu.cz/cgi-bin/mapserv.exe?map=c:\mapservdata\data\data_slp\krtiny.map&version=1.1.1&service=WMS&request=GetMap&layers=landuse&format=image/png

Proj compilation and installation:

windows: > cp proj-4.9.src c:\proj
windows: > cd c:\proj\src
cygwin:  > patch PJ_krovak.c PJ_krovak.c.patch
windows: > nmake /f makefile.vc all
cygwin:  > cd /cygdrive/c/proj/
cygwin:  > ./configure --prefix=/cygdrive/c/proj
cygwin:  > make
cygwin:  > make install

Thank you for any reply 

Jachym
-- 
Jachym Cepicky                                  
e-mail: jachym.cepicky at centrum.cz           
URL: http://les-ejk.cz                      
GPG: http://les-ejk.cz/gnupg_public_key/    
-----------------------------------------   
OFFICE:                                     
Department of Geoinformation Technologies   
LDF MZLU v Brně                             
Zemědělská 3                                
613 00 Brno                                 
e-mail: xcepicky at node.mendelu.cz            
URL:    http://mapserver.mendelu.cz
Tel.:   +420 545 134 514


More information about the Proj mailing list