Map API

Nutiteq Maps Lib SDK enables developing advanced mobile mapping applications.
Platforms: Android, RIM BlackBerry, Java ME (J2ME)
Download maps API SDK »
Untitled Document

Products

» View demos
» Downloads

Uudised

Viimane: Thu, 15 Mar 2012 14:51:08
Teema: Vabad töökohad pakkuda
Veel uudiseid »

Server side script for NutiteqStreamedMap API

1 reply [Last post]
abhirama
User offline. Last seen 1 year 22 weeks ago. Offline
Joined: 07/17/2009

Hi,

I have implemented server side script to calculate BBOX for tileX,tileY. But it seems there's some mistake in calculating BBOX. I get tiles, but with Y-offset of more than 128 px. Can you please share me server side script to interpret NutiteqStream tile request URL, which calculates BBOX to get tiles for tileX,tileY?
Pseudo code algorithm is also fine.

Also I am pasting my code snippet which does tileX,tileY to BBOX conversion, incase you can point error -

------------------
while(@xy){
$tileX = shift(@xy);

$tileY = shift(@xy);

$mapTopLeftX = $tileX*$resolution[$z]*$tileSizeInPixel-180;

$mapTopLeftY = 180-$tileY*$resolution[$z]*$tileSizeInPixel;

$mapBottomRightX=$mapTopLeftX + $resolution[$z]*$tileSizeInPixel;

$mapBottomRightY=$mapTopLeftY - $resolution[$z]*$tileSizeInPixel;

//tilecache URL http://server/cgi-bin/tilecache.cgi?LAYERS=LAYER_NAME&FORMAT=image%2Fpng&SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&STYLES=&EXCEPTIONS=application%2Fvnd.ogc.se_inimage&SRS=EPSG%3A4326&BBOX=$mapTopLeftX,$mapTopLeftY,$mapBottomRightX,$mapBottomRightY&WIDTH=64&HEIGHT=64\n";
}

-------------------------------------------------

jaak
User offline. Last seen 4 days 19 hours ago. Offline
Joined: 06/19/2008

It seems that you try to project the tiles to EPSG:4326 coordinate system. Does the client use this too? Most streaming API implementations in client (like NutiteqStreamedMap) use Google Mercator EPSG3785 and this has shift in Y direction, as Y-direction resolution is different (Google Mercator Y-span is -85.05112877980659 to 85.05112877980659).

I have a converter script for EPSG3785 and WMS back-end in EPSG3785 which works at least with MapServer (but not guaranteed for other backends). Please email to nutiteq@nutiteq.com, we can share it for a small fee, or for free if you have library commercial license.

/JaakL