Vishful thinking…

TileCutter update – With support for OSM and WMS map services

Posted in .NET, ArcGIS, C#, ESRI, GIS, OpenSource, Utilities by viswaug on June 28, 2011

I just added support for creating MBTiles caches for WMS map services and also to download OSM tiles into the MBTiles format. MBTiles cache for WMS map services would improve map rendering performance, but why did i add support for OSM tile sets? Well, they will come in handy for disconnected/offline use cases. So, here are some usage examples

ArcGIS Dynamic Map Service:

TileCutter.exe -z=7 -Z=9 -x=-95.844727 -y=35.978006 -X=-88.989258 -Y=40.563895 -o=”C:\LocalCache\ags.s3db” -t=agsd -m=””

WMS Map Service 1.1.1:

TileCutter.exe -z=7 -Z=9 -x=-95.844727 -y=35.978006 -X=-88.989258 -Y=40.563895 -o=”C:\LocalCache\wms111.s3db” -t=wms1.1.1 -m=””

WMS Map Service 1.3.0:

TileCutter.exe -z=7 -Z=9 -x=-95.844727 -y=35.978006 -X=-88.989258 -Y=40.563895 -o=”C:\LocalCache\wms130.s3db” -t=wms1.3.0 -m=””


TileCutter.exe -z=7 -Z=9 -x=-95.844727 -y=35.978006 -X=-88.989258 -Y=40.563895 -o=”C:\LocalCache\osm.s3db” -t=osm -m=””

And always just type “TileCutter -h” for usage information.

Want to customize the parameters with which the maps are being generated? Just use the “-s” command line option ans specify the setting in a query string format.

TileCutter.exe -z=7 -Z=9 -x=-95.844727 -y=35.978006 -X=-88.989258 -Y=40.563895 -o=”C:\LocalCache\ags.s3db” -t=agsd -m=”” -s=”transparent=true&format=jpeg”

Also, if some of the tile requests result in errors, the level, column, row and error message information would be logged into a text file in the same directory as the MBTiles cache.

And now, for the best new feature of TileCutter, the program does not store duplicate tiles. That is, if the area you are caching has a lot of empty tiles in the ocean etc, the MBTiles cache created by TileCutter will only store one tile for all those duplicated tile images. Should help save disk space 🙂

TileCutter can be downloaded here


Comparing OpenLayers and MapBuilder

Posted in GIS, OpenSource by viswaug on November 30, 2007

I have been doing some research into comparing OpenLayers and MapBuilder to determine which will be more suitable for one our projects. I also wanted to get more familiar with the two technologies. I had played around with OpenLayers before but didn’t attempt any customizations to the existing functionalities that are available by default. There are a lot more of similar AJAX-enabled open-source web mapping applications that are available but OpenLayers and MapBuilder were the most promising ones. So, here you go…

OpenLayersOpenLayers is a pure JavaScript library for displaying map data in most modern web browsers, with no server-side dependencies. OpenLayers implements industry-standard methods for geographic data access, such as the OpenGIS Consortium’s Web Mapping Service (WMS) and Web Feature Service (WFS) protocols and other standard vector layers for the web like GeoRSS, GML etc. OpenLayers tries to separate map tools from map data so that all the tools can operate on all the data sources. The supported layers in OpenLayers are:

WMS, WFS, TMS, GeoRSS, GML, Google Layers, Geo-referenced Image Layer, MapServer Layers, VirtualEarth Layers, Yahoo Layers, WorldWind Layer, TileCache Layer.

The data layers supported by OpenLayers is extensible and support can be added for other custom data sources. A lot of ESRI users will be excited to know that there is an example showing OpenLayers using the MapCache of ArcGIS server 9.2 that can be seen here.

MapBuilderMapBuilder is an open source project allowing you to easily add dynamic maps and information from many other sources to your web site. The interesting thing here is that the MapBuilder development team is playing smart and are in the process of integrating OpenLayers into MapBuilder. This integration will eventually lead to OpenLayers to be the rendering engine behind the MapBuilder web applications. MapBuilder makes it easier to build new map widgets to enhance map interaction and to enable custom map functionalities. Building new map widgets is available through a well designed and easily configurable MVC framework at the client-side. Here are the key features of MapBuilder as listed on their website.

  • Browser based mapping client
  • Standards compliant, supports the Open Geospatial consortium(OGC) standards
  • Renders maps from Web Map Services (WMS), Web Feature Services (WFS), GeoRSS, Google Maps
  • Supports editing map features to Transactional Web Feature Services (WFS-T)
  • Allows users to build their own maps, then save and share them, using Web Map Context (WMC) and Open Web Services Context
  • Easy to use
  • Fast and interactive – built using AJAX
  • Works with most modern browsers (Firefox 1.0+, Internet Explorer 6.0+, Mozilla 1.3+, Navigator 6+)
  • Customisable and easy to extend
  • Open source under the LGPL licence
  • No plugins required

The feature matrix for MapBuilder can be found here.

After reading through the documentation available on both OpenLayers and MapBuilder, I still didn’t think that I had enough technical information on the implementation of the two technologies to make an informed and intelligent decision on which technology would be ideal for us. So, I set forth asking questions on the forums for both the technologies. Emanuel Schütze responded and forwarded me his thesis work where he had done an extensive comparison of the latest web mapping technologies. His thesis work is a must read to delve more into the details of the above two and other web mapping technologies. His thesis work can be downloaded from here. Here is a feature comparison chart from his chart.


The chart above compares the various usability features among the various web mapping applications. Well, that’s great, but friendly is OpenLayers for custom feature development. Well, I set out trying to simple little customizations to the OpenLayers controls etc. After, fumbling my way around quite a bit and spending a whole lot of time in FireBug I was able to accomplish what I setout to do. What I learnt from that experience was that the customizations that might be required can be accomplished if got your CSS and JavaScript Kung-fu on. Given, that OpenLayers does not come with a whole suite of tools that regular map users are used to, more custom navigation and other tools need to be developed for a feature rich web mapping application. Developing those new tools can be overwhelming if you are not as comfortable in the JavaScript web environment as you are with the windows environment and have been pampered and spoiled by Visual Studio. If you set out to create a custom control for OpenLayers, you need to study the existing controls and use them as the starting point to create our own as there no documentation or example on the subject. The documentation that is available to help and guide you through the framework is sparse at best. But once you get comfortable with the framework, OpenLayers provides a real powerful web mapping application development platform. Examples using OpenLayers in various scenarios can be found here. The class diagram for the OpenLayers framework is shown below.


MapBuilder brings additional feature sets to the table. It allows for things like allowing users to build their own maps, then save and share them, using Web Map Context (WMC) and Open Web Services Context. These contexts are an XML representation of the LayerList, AreaOfInterest and some metadata. Most MapBuilder widgets perform client-side XSL transformation of the context documents to determine the display. Other MapBuilder widgets also transform the following 1) GML – e.g. to produce a list of feature attributes 2) A Context Collection 3) A Capabilities document 4) A response from a Catalog query etc. OpenLayers is currently working on their support for using WMC. MapBuilder supports SLD and is a SLD editor. SLD describes how to render features. It also supports editing map features to Transactional Web Feature Services (WFS-T). But there is a word of caution there because some server-side(Apache-PHP stack) features are required to accomplish that functionality. This I learnt from Cameron Shorter, “There is one security limitation using HTML faced by both Mapbuilder and Openlayers. You can only POST a request to the server that the HTML comes from. This is an issue when trying to access a service like a WFS from another server. Both Mapbuilder and Openlayers have a server side proxy to address this. All the rest of Mapbuilder and Openlayers code is client side.“.

MapBuilder does come with a lot more of the basic map navigation features that GIS users are used to. Unlike OpenLayers whose Navigation toolbar comes with just two controls (zoom and pan). MapBuilder also has more documentation for creating new functionalities compared to OpenLayers. But that is not to say that it is easier to learn. The OpenLayers framework could be a lot easier to learn given some good documentation rather than reading existing code. The framework for creating new widgets is also pretty well designed with a configurable MVC pattern that developers can relate to more easily.

The releases for OpenLayers are very well managed and are frequent to address issues quickly but on the other hand the release management for MapBuilder is not as good. It has been a year and a half since the last stable release for MapBuilder. OpenLayers has graduated incubation from OSGEO.

So in conclusion, If you just want a map and a few common widgets on the display, OpenLayers might be for you. If you want to design and develop new custom widgets to work with data sources from a number of sources then MapBuilder may be better.

OpenSource GIS Notes

Posted in GIS, OpenSource by viswaug on November 18, 2007

I thought I would pass along some interesting information about recent happenings in OpenSource GIS. The annual Free and Open Source Software for Geospatial (FOSS4G) conference took place in September in Victoria, Canada. This would have been a really good conference to attend with a lot of cool sessions on the latest developments in the rapidly changing world of open source GIS. The FOSS4G group has posted the presentations from the 2007 conference online. It is really good read if you are interested. It might not be as good as being able to attend the conference but it is great for developers who couldn’t afford the time off or the travel. Off the presentation I was able to read till now, I found the presentation titled “Using the Atom Publishing Protocol for Web GIS” really cool. The author talks about why the WFS standard could soon be replaced by the “Atom Syndication Format” and the “Atom Publishing Protocol“.

OSGEO announces that OpenLayers gradutes incubation. Not entirely sure what to make of it but OpenLayers does have a stable 2.5 release out. Even though their documentation has come a long way from where it used to be, I still wish they had a better design overview document and more samples that serve to illustrate the length and breadth of the currently existing functionalities. It will be of enormous help for any developer trying to get up to speed with the SDK and perhaps even enable wider adoption of the truly awesome technology.

Also, I am publishing this post using ScribeFire from within FireFox. Pretty cool.