Category Archives: WMS

iKatastr rocks !

This is somehow very encouraging

#1 iKatastr is still on top in the category Navigation in Czech app store after 4 months ! on iPhone it keeps 2nd place right after Mapy CZ provided by largest internet search in CZ Seznam.  On iPad, however, iKatastr is still 1st in category Navigation.

#2 Users of iKatastr has reported quite lot positive feedbacks, see here : http://appcomments.com/app/id396352287/iKatastr_reviews?country=143489&show=show_all_comments&sort=sort_recent&sortorder=sort_ascend&page=1

#3 IKatastr has been mentioned in Czech magazine “Mobility” 1/2011, on page 85.

 Quoted from the magazine press:

“There are just few  high quality applications in the Czech App Store. Even fewer of them are for free.
 iKatastr developed at Mendel University in Brno belongs to this narrow group with functionality that is also unique in the international comparison. “

——————-
 Jiri Kaminek (developer of the iKatastr) will reveal more statistics about usage of iKatastr in his upcoming thesis.  I can tell here just the following interesting observation : iPhone usage of iKatastr is approximately 10x higher than of the web  (www.ikatastr.cz


Windows Phone 7 and WMS test

   I have quickly tested my new Windows Phone 7 (Samsung Omnia) device with the Czech cadastral map WMS overlay over the BingMaps and DeepEarth (also see this blog here: http://blog.sumbera.com/2010/11/10/wms-overlay-on-bing-maps-vs-deepearth-on-wp7/) . if you are familiar with www.ikatastr.cz and iPhone version of it (iKatastr) than this example is using same data sources.

In short : it was a great experience – WP7 was smoothly  registered, automaticaly connected to internet even without  a SIM card using USB cable and Visual Studio 2010 integration just works perfect (so far:) In comparison to many difficulties and ‘certification hell’ on iPhone this is a great relief. Now giving the fact that Nokia is going to support and develop Windows Phone 7, great user experience with WP7 and (for me and menay others) great development experience, this might change the mobile landscape significantly over the 1 or 2 years.

I will guess here that WP7 platform will exceed number of iPhone applications in less than 2 years.


WMS overlay on Bing Maps vs. DeepEarth on WP7

2 comparisions videos of runing Bing maps and DeepEarth with tiled WMS overlay.

BING MAPS:

DEEP EARTH:


OpenLayers or GoogleMap v3 for mobile web app ?

I have experimented with OpenLayers 2.9 using touch.js extension for capturing touch events from iPhone/iPad. Although stripped down version of OL is about 184KB, the performance is very bad. If you have iPhone/iPad check this experiment: http://www.sumbera.com/lab/iphone/katastr.htm (note it will not work from desktop browser)

 OL team is working on v3 of OL to be more lighter, faster even for mobile devices, see here: http://trac.osgeo.org/openlayers/wiki/three  or here : http://openlayers.org/blog/2010/06/30/openlayers-3-on-github/

 Meanwhile I have tested new GoogleMaps v3 how it works on iPhone/iPad. despite few problems (stability, problems with cached tiles or disconnected JavaScirpt  to load new tiles -iPad)  it works pretty well . Check yourself this page from your mobile touch device (iPhone.iPad,Android): http://www.ikatastr.cz/iKatastrM.htm

Conclusion : Google Maps v3 wins on mobile over the Openlayers 2.9

 

[2011 September] UPDATE : new Openlayers 2.11 works quite well on iPad/iPhone.


Tiled WMS overlay in Windows Phone 7

  This post [http://blog.sumbera.com/2010/02/25/overlay-wms-on- google-in-silverlight-bing/ ] talked about how to overlay over the Bing maps Silverlight control Google tiles  and tiled WMS. It was quite easy to port this web sample into the Windows Phone 7 emulator. I took a smaple code from Training kit called “Ex1-TheBingMapControl” and extend it with the 2 classes : GoogleTile and WmsTile, with slight changes to the namespace using Microsoft.Phone.Controls.Maps (original for Silverlight was  Microsoft.Maps.MapControl). Then extend MainPage.XAML with :

                    <my:MapTileLayer Opacity=”1″>
                        <my:MapTileLayer.TileSources>
                            <local:GoogleTile></local:GoogleTile>
                        </my:MapTileLayer.TileSources>
                    </my:MapTileLayer>
                    <my:MapTileLayer Opacity=”1″>
                        <my:MapTileLayer.TileSources>
                            <local:WMSTiledOverlay></local:WMSTiledOverlay>
                        </my:MapTileLayer.TileSources>
                    </my:MapTileLayer>
 
 

Extended sample code availabel for download here : http://www.sumbera.com/lab/wp7/TheBingMapControlWithWMSandGoogle.zip

 Update: I found the way calculating BoundingBox from the quadkey somehow limiting (the DeepEarth weay) since it worked only till the level 18. So here is updated class fro getting correct bounding box of the tiled WMS request in the Bing Silverlight control:

            public static double TileToWorldPosX(double tile_x, int zoom) {
                return  (float)((tile_x / Math.Pow(2.0, zoom) * 360.0) – 180.0);
            }
            public static double TileToWorldPosY( double tile_y, int zoom) {
                double n = Math.PI – ((2.0 * Math.PI * tile_y) / Math.Pow(2.0, zoom));
                return   (float)(180.0 / Math.PI * Math.Atan(Math.Sinh(n)));
            }
            public override Uri GetUri(int tilePositionX, int tilePositionY, int tileLevel) {
                int zoom = tileLevel; //SSU tileLevel would be same as zoom in Bing control
                double deltaX = 0;// 0.00135; //SSU deltaX for SLP WMS
                double deltaY = 0;// 0.00058; //SSU deltaY for SLP WMS
                double minXLon = TileToWorldPosX(tilePositionX, zoom) + deltaX;
                double minYLat = TileToWorldPosY(tilePositionY + 1, zoom) + deltaY;
                double maxXLon = TileToWorldPosX(tilePositionX + 1, zoom) + deltaX;
                double maxYLat = TileToWorldPosY(tilePositionY, zoom) + deltaY;
                string wmsUrl = string.Format(this.UriFormat, minXLon, minYLat, maxXLon, maxYLat, 256);
                return new Uri(wmsUrl);
            }
        
        }
   

 


Tiled WMS overlay on Google Map v3

this is the third sample of the tiled WMS overlay over the Spherical Mercator, this time over the new Google Map v3. Previsous post talked about overlyaing WMS in  Silverlight Bing maps (http://blog.sumbera.com/2010/02/25/overlay-wms-on-google-in-silverlight-bing/ ) and OpenLayers (http://blog.sumbera.com/2010/02/17/overlay-wms-on-google-in-openlayers/).

Sample application can be found here: http://www.sumbera.com/lab/GoogleV3/tiledWMSoverlayGoogleV3.htm You can try to run it on your mobile device as well – suprisingly it run very well on my iPhone (sometimes it just crash Safari :), however on the iPad there are some more serious issues that will be hopefuly resolved with new iOS update (JavaScript stops to run).

For the new Google Map v3 you have to do the following :

//Define custom WMS tiled layer
var SLPLayer =
 new google.maps.ImageMapType (
 {
  getTileUrl:
    function (coord, zoom) { 
      var proj = map.getProjection(); 
      var zfactor = Math.pow(2, zoom); 
       // get Long Lat coordinates
      var top = proj.fromPointToLatLng(
             new google.maps.Point(coord.x * 256 / zfactor, coord.y * 256 / zfactor) ); 
      var bot = proj.fromPointToLatLng(
            new google.maps.Point((coord.x + 1) * 256 / zfactor, (coord.y + 1) * 256 / zfactor)); 
      //corrections for the slight shift of the SLP (mapserver)
       var deltaX = 0.0013; 
       var deltaY = 0.00058; 
     
      //create the Bounding box string
       var bbox = (top.lng() + deltaX) + “,” +(bot.lat() + deltaY) +“,”
                           +(bot.lng() + deltaX) +“,” +(top.lat() + deltaY);
      
       //base WMS URL
        var url =
       “http://mapserver-slp.mendelu.cz/cgi-bin/mapserv?map=/var/local/slp/krtinyWMS.map&” ;
       url +=“&REQUEST=GetMap”; //WMS operation
       url +=“&SERVICE=WMS”; //WMS service
       url +=”&VERSION=1.1.1″; //WMS version 
       url +=“&LAYERS=” + “typologie,hm2003″; //WMS layers
       url +=“&FORMAT=image/png”; //WMS format
       url +=“&BGCOLOR=0xFFFFFF” ;
       url +=“&TRANSPARENT=TRUE” ;
       url +=“&SRS=EPSG:4326″; //set WGS84 
       url +=“&BBOX=”+ bbox; // set bounding box
       url +=“&WIDTH=256″; //tile size in google
       url +=“&HEIGHT=256″ ; 
       return url; // return URL for the tile    
     }, //getTileURL
 tileSize: new google.maps.Size(256, 256),
 isPng: true
 }); 
 //add WMS layer 
 map.overlayMapTypes.push(SLPLayer); 

 
 
 

Overlay WMS on Google in Silverlight Bing

This post talked about the way how to enable WMS over the Google in OpenLayers  (or other Spherical Mercators) maps – http://blog.sumbera.com/2010/02/17/overlay-wms-on-google-in-openlayers/  and this post about overlying tiled WMS over the new Google Map v3 (http://blog.sumbera.com/2010/11/02/tiled-wms-overlay-on-google-map-v3/ ) 

This post is about testing this inside the Silverlight Bing map control.

 The quick preview is available here :

http://www.sumbera.com:80/lab/silverlight/SilverlightApplication3TestPage.aspx  

and below is the main routine that calls WMS request from Silverlight (thanks to DeepEarth open source project !): 

   

/// Routine from DeepEarth to display WMS as tile inside the Silverlight control 
/// http://deepearth.codeplex.com/sourcecontrol/changeset/view/37324?projectName=deepearth#583728 
/// modified to work in Bing map control 
public override Uri GetUri(int tilePositionX, int tilePositionY, int tileLevel) { 
int zoom = tileLevel; //SSU tileLevel would be same as zoom in Bing control  
string quadKey = TileXYToQuadKey(tilePositionX, tilePositionY, zoom);// Use the quadkey to determine a bounding box for the requested tile 
BBox boundingBox = QuadKeyToBBox(quadKey); 
double deltaX = 0.00135; //SSU deltaX for SLP WMS 
double deltaY = 0.00058; //SSU deltaY for SLP WMS 
// Get the lat longs of the corners of the box 
double lon = XToLongitudeAtZoom(boundingBox.x * TILE_SIZE, 18) + deltaX; 
double lat = YToLatitudeAtZoom(boundingBox.y * TILE_SIZE, 18) + deltaY; 
double lon2 = XToLongitudeAtZoom((boundingBox.x + boundingBox.width) * TILE_SIZE, 18) + deltaX; 
double lat2 = YToLatitudeAtZoom((boundingBox.y – boundingBox.height) * TILE_SIZE, 18) + deltaY; 
  
string wmsUrl = string.Format(this.UriFormat, lon, lat, lon2, lat2, TILE_SIZE); 
return new Uri(wmsUrl);  
 
 
Update 10/2010:  above routine is limited only to 18 zoom levels,please check the new routine for calculating BBOX in silverlight Bing  here  http://blog.sumbera.com/2010/11/07/tiled-wms-overlay-in-windows-phone-7/
 

Overlay WMS on Google in OpenLayers

[Note: therea are related post: overlyaing tiled WMS over the new Google Map v3 http://blog.sumbera.com/2010/11/02/tiled-wms-overlay-on-google-map-v3/ and overlying tiled WMS over the Silverlight Bing map http://blog.sumbera.com/2010/02/25/overlay-wms-on-google-in-silverlight-bing/ ]

Is it possible to display WMS (EPSG:4326) over the Google (EPSG:900913) in Openlayers ? Yes ! thanks to the great img ’feature’ that enables you to shrink/expand your return image based on defined image size. That means that if your map view is rectangular or you request WMS as tiles (rectangular too) you get proper overlay of EPSG:4326 on EPSG:900913) . Example of various image sizes follows (these are actually WMS GetMap requests):

256 x 160

256 x 256

  Here is the way how to implement it in OpenLayers – very simplified:

1. read this post http://docs.openlayers.org/library/spherical_mercator.html and create your Google map:

var options = {
                projection: new OpenLayers.Projection(“EPSG:900913″),
                displayProjection: new OpenLayers.Projection(“EPSG:4326″),
                units: “m”,
                numZoomLevels: 22,
                maxExtent: new OpenLayers.Bounds(-20037508, -20037508,
                                                 20037508, 20037508.34)
            };
            map = new OpenLayers.Map(‘map’, options);
            // create Google Mercator layers
            var ghyb = new OpenLayers.Layer.Google(
                “Google Hybrid”,
                { type: G_HYBRID_MAP, ‘sphericalMercator’: true }
            ); 

2. add your WMS layer

var gwms = new OpenLayers.Layer.TMS(“SLP”, “http://mapserver-slp.mendelu.cz/cgi-bin/mapserv?map=/var/local/slp/krtinyWMS.map&”,
                                    {
                                     layers: ‘obrys,typologie,hm2003′,
                                     type: ‘png’,
                                     visibility: true,
                                     getURL: get_wms_url,
                                     format: “image/png”,
                                     opacity: 1,
                                     isBaseLayer: false,
                                     deltaX: 0.0013,  
                                     deltaY: 0.00058
                                    });
 

3. include support for reprojection before you include OpenLayers:

<script src =”proj4js/lib/proj4js-combined.js”>script>

4. handle WMS as TMS tiles as this:

function get_wms_url(bounds) {

// recalculate bounds from Google to WGS
   var proj = new OpenLayers.Projection(“EPSG:4326″);
    bounds.transform(map.getProjectionObject(), proj);

// this is not necessary for most servers display overlay correctly,
//but in my case the WMS  has been slightly shifted, so I had to correct this with this delta shift

            bounds.left += this.deltaX;
            bounds.right += this.deltaX;
            bounds.top += this.deltaY;
            bounds.bottom += this.deltaY;

            //construct WMS request

          var url = this.url;
            url += “&REQUEST=GetMap”;
            url += “&SERVICE=WMS”;
            url += “&VERSION=1.1.1″;
            url += “&LAYERS=” + this.layers;
            url += “&FORMAT=” + this.format;
            url += “&TRANSPARENT=TRUE”;
            url += “&SRS=” + “EPSG:4326″;
            url += “&BBOX=” + bounds.toBBOX();
            url += “&WIDTH=” + this.tileSize.w;
            url += “&HEIGHT=” + this.tileSize.h;
            return url;

        }

That is, live example you can see here http://www.sumbera.com/lab/wms/getcapWGS.htm

or in MapShake here : http://www.mapshake.cz/mapfs.aspx?i=464


More Whatevermap screenshots


WhateverMap on Apple Store

WhateverMap Lite v1.0, developed by Jiri Kaminek  has been today accepted for distribution through Apple Store . You can download it here (iTunes and iPhone requiered):

tms://itunes.apple.com/WebObjects/MZStore.woa/wa/viewSoftware?id=326649571&mt=8&s=143441

WhateverMap is similar to Google Maps but you can use different branch-specific map sources. Those sources should be more interesting and valuable in non-navigation filed of map using. WhateverMap use Web Map Services (WMS). WMS standard specification was created by the Open Geospatial Consortium (OGC). WMS may provide any geospatial data. There are many WMS severs and most of them are available for free. You can find servers with ortophoto, cadastral, soil types, migration of white storks, … simply WHATEVER.
You can add any WMS server by typing an URL address or simply use built-in catalog. There are some servers with interesting data as NASA Earth satellite photos, Mars satellite photos and many others. There is a rich list of Czech WMS servers.
You can browse a map using zoom-in, zoom-out or move. For better orientation it is possible to use actual position provided by built-in GPS module. Each WMS should map only limited area so there is a boundary of each map. It is possible to display whole map with boundary too.
It is possible to consume many sources in this application. So there is an easy way to change a source while browsing the map. You can easily compare the same area in different map sources. For example you can find out any building and then you can choose soil type map to determine stability of building’s foundation.
For better control of map there is a movement history. Sometimes GPS get lost a signal and display non-precision region. In this case it is posible to use undo and get more precision area before you get lost a signal. There is another interesting way to use the history. You can move around an area in first map layer and then use the same movements in different layers. For example you can follow a road and then you can use map layer with water or soil pollution to find out effect of road to water or soil quality.

MAP CONTROL:
・ZOOM-IN – double tap
・ZOOM-OUT – triple tap
・MOVEMENT – swipe on map

FEATURES:
- Consume any WMS server map data (ortofoto, cadastral, mars, … WHATEVER)
- Map browsing (move, zoom)
- Support history in map movements (UNDO, REDO)
- Display your current location
- Display map boundary
- Change background color
- Movement history(UNDO, REDO)
- favourite list of WMS

WHAT TO EXPECT IN THE NEXT RELEASES:
- searching by location name (city, roads, country, …) – geocoding
- caching
- saving for offline use
- better catalog
- landmarks

WHAT’S NEW IN THIS VERSION:
first release

LANGUAGES:
English

REQUIREMENTS:
Compatible with iPhone and iPod Touch
Requires iPhone OS 2.2.1 or later

What’s new

English

Screenshots


Follow

Get every new post delivered to your Inbox.