Another map type - mapy.cz

Topics: Feature Requests
Oct 5, 2010 at 9:34 AM

Hello guys,

 

after I saw the huge amount of map servers, that are supported (google, bing, yahoo, ...), I wondered, if it is possible to use other type.

To be concrete - our czech site mapy.cz is in some cases better than google and I would like to use them if possible. Example link:  http://mapy.cz/#mm=TtTcFP@sa=s@st=s@ssq=praha@sss=1@ssp=124542060_114618060_146037868_145911500@x=133194275@y=135845724@z=9

 

Is there any tutorial how to do it?

Thanks, stej

Coordinator
Oct 5, 2010 at 11:00 AM
Edited Oct 15, 2010 at 3:35 PM

Let's see!

Step 1: where are tiles?

http://m1.mapserver.mapy.cz/base-n/3_8000000_8000000

 

Step 2: how to make request url?

public string MapyMap(int zoom, int x, int y)
{
    zoom = 0x11 - zoom;
    y = (((int) Math.Pow(2.0, (double) zoom)) - 1) - y;
    return ("http://mapserver.mapy.cz/" + MapyVersion + "/" + zoom.ToString() + "_" + decToHex(x.ToString(), zoom) + "_" + decToHex(y.ToString(), zoom));
}

public static string decToHex(string param, int scale)
{
    int num2 = int.Parse(param) << (0x1c - scale);
    return string.Format("{0:x7}", num2);
}

Step 3: how to convert from coordinates to tile indexes?

SR-ORG:98, Mapy.cz Projection - used on www.mapy.cz for raster tiles and for POI database. Mapy.cz is a Google Maps alternative with the high quality data coverage for Czech Republic. It is a slightly modified EPSG:32633 (WGS84/UTM zone 33).

PROJCS["Mapy.cz",GEOGCS["GCS_WGS_1984",DATUM["D_WGS_1984",SPHEROID["WGS_1984",6378137,298.257223563]],PRIMEM["Greenwich",0],UNIT["Degree",0.017453292519943295]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",15],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",134400000],PARAMETER["false_northing",-41600000],UNIT["1/32meter",0.03125]]

Step 4: engage!

 

Step 5: make it so! ;}

Oct 5, 2010 at 2:05 PM

Wow, looks promising.

Thx, I'll try that ASAP.

Oct 12, 2010 at 12:16 AM
Edited Oct 12, 2010 at 12:17 AM

I noticed you added some support for mapy.cz which is great!

You wrote that there are some problems - do you think it is possible to fix them? From a quick look I found out that the whole coordinates stuff is a little bit mystery for me :)

Coordinator
Oct 12, 2010 at 4:45 AM

welcome to the Transylvania, mystery of Dracula is always here ;] ..anyway there is a way in every map, just takes time to find it, help is welcome ;}

Coordinator
Oct 15, 2010 at 10:59 AM

i've found the way, but somehow the formulas in official javascript isn't very accurate, or maybe i've missed something.. hm ;/

Oct 15, 2010 at 1:56 PM

"help is welcome ;}"

Sure :) I would help, but from what I've seen I have almost no clue how the maps/coordinates etc. work. I've tried something but without any usable result :|

Coordinator
Oct 15, 2010 at 3:34 PM

it's done, cheers ;}