MapSurfer.NET 2.5

July 24, 2016

Today, we are excited to announce the release of MapSurfer.NET v.2.5 (beta). This release includes the results of a hard work which have been done over the last seven months.

This release is a milestone in the project's history. It introduces a bunch of new features that allow to design maps using a powerful stylesheet-like language CartoCSS. One of the key goals of this release is to provide a powerful cartographic tool for interchanging and converting map styles from/to different mapping applications, for example GeoServer, Mapnik or MapServer, etc.

With support of CartoCSS, MapSurfer.NET Studio can now be considered as an alternative to popular tools such as TileMill or Kosmtik. Furthermore, MapSurfer.NET Studio provides much more features than other competitors. Among this features are:

  • Open and edit existing CartoCSS projects.
  • Export map styles into Mapnik XML or MapServer map file (see Figure 6). Thanks to magnacarto project.
  • Save map styles as an SLD file (see Figure 7).
  • Design maps in many projections, i.e. no more need to stick to Spherical Mercator.
  • Advanced label placement which includes label prioritization, solvers (e.g. Greedy, Simulated Annealing, etc), etc (see Figure 4).
  • Great variety of data source providers, for example PostgreSQL, Shapefile, GeoJson, Vector Tiles, MSSQL, MySQL and many more other formats supported by GDAL (see Figure 5).
  • Generate tiles into any of 18 different tile caches, for example MbTiles, Memcached, BerkeleyDB, etc.
  • Layer groups and compositing (see Figure 7).
  • Performance measurement to analyze time needed to fetch data or render them (see left panel in Figure 1).
  • Export maps to raster (bmp, jpeg, png) or vector image (svg, pdf).

Check out the full list of changes.

It is really easy to try out MapSurfer.NET. Just download the latest build of MapSurfer.NET from here and make a couple of clicks. Note this release requires .NET Framework 4.6 and Microsoft Visual C++ Redistributable Package 2015 Update 2.

CartoCSS Processor

In our previous blog post, we introduced the support of CartoCSS language through a port of carto library to C#. The original implementation had the same performance issues as carto when it comes to process large style-stylesheets such as openstreetmap-carto. According to a post in OSM mailing list, carto needs about 10s to convert openstreetmap-carto to Mapnik XML. This amount of time makes map design a very time-consuming task. To improve the situation, guys from omniscale developed Magnacarto library that allows generating Mapnik XML and MapServer map files from a CartoCSS project. Their implementation is written in Go and as they stated "supports nearly all features of CartoCSS". In users tests, Magnacarto demonstrated amazing performance, namely it was able to process openstreetmap-carto in 1.24s vs 10.08s taken by carto on a machine with Intel Core i5-4300U running Linux x64.

Being inspired by the performance of Magnacarto, we decided to rewrite some critical parts of the CartoCSS module with a goal to improve its overall performance. The results are more than satisfactory. We ran the same test of processing openstreetmap-carto using Magnacarto and MapSurfer.NET on Windows 7 Pro x64 equipped with Intel(R) Core(TM) i5-2500 CPU @ 3.30 GHz. The libraries showed 1.33s and 1.09s respectively. It is also important to note that, in comparison to carto and Magnaarto, CartoCSS module in MapSurfer.NET translates map styles directly to map objects without creating temporary files (e.g. Mapnik XML or MapServer map file).

MapSurfer.NET Studio Redesign

For those of you who have been already exploiting MapSurfer.NET Studio for map styling, we have even more exciting news. The MapSurfer.NET Studio got a significant enhancement, namely a built-in CartoCSS editor, which in its first version allows editing multiple styles, has syntax and error highlighting. Additionally, we have improved several dialogs and controls to make users work more handy and intuitive. The series of screenshots below demonstrate these improvements.


Figure 1. User interface elements.


Figure 2. CartoCSS text editor.


Figure 3. Layer options (padding, feature caching, compositing operation and opacity).


Figure 4. Advanced labeling settings.


Figure 5. Layer's data source selection.


Figure 6. Exporting CartoCSS styles as Mapnik XML or MapServer map file using magnacarto library.


Figure 7. Exporting map styles as an SLD file.


Figure 8. A new dialog showing the stages of the project loading.


Figure 9. Redesign of recent projects dialog.

Video 1. CartoCSS editor

List of Changes


  • Added: The "Equal Tilde" operator (=~) that allows using regular expressions.
  • Added: New parameter StronglyTypedExpressions.
  • Added: Additional parameters in ColorMap property of RasterSymbolizer. These parameters are DefaultColor, DefaultMode and Epsilon.
  • Added: New halo mode SolidAndBlurred.
  • Added: PointPlacementPriotization property to LabelPlacementSettings which defines a list of preferred placements for point-feature label placement (for example, Imhof's or Yoeli's guidelines).
  • Added: BackgroundDataFetch property in RenderContext.
  • Improved: Performance of the look-up table that resolves coordinate systems by id.
  • Improved: More detailed exception when the layer extent is null.
  • Improved: More detailed exception when a font is not installed.
  • Improved: Improved performance of inserting tiles into an MbTiles database.
  • Fixed: TextSymbolizer doesn't clip geometries.
  • Fixed: Unnecessary line break in PointPlacement when the text block starts with a line feed character '\n'.
  • Fixed: Clipping in LineSymbolizer does not treat Polygons as LineStrings.
  • Fixed: Flipped coordinates (latitude 180 degrees) in geocentric transformation.
  • Upgraded: .NET Framework 4.6 is now required.


  • Added: Support for Tiny well-known binary format in PostGIS plugin.
  • Added: Support for IntegratedSecurity (PostGIS).
  • Fixed: Several bug fixes and improvements in CartoCSS module.
  • Fixed: The combination of characters such as "\n" (two chars) is not considered as a line break.
  • Fixed: OGR plugin crashes when a field with X-coordinate has 'lon' name.
  • Fixed: Multipolygons are missing in OSM plugin.
  • Fixed: Graphic object is not properly positioned when Size property is given.
  • Fixed: Halo is rendered with a dashed stroke (GDI renderer).
  • Fixed: Incorrect rendering of Smooth halo mode (Cairo renderer).
  • Improved: Memory consumption and performance in decoding vector tiles.
  • Improved: Support for more complex queries in PostGIS data provider.
  • Upgraded: System.Data.SQLite library has been upgraded to version 1.0.99.
  • Upgraded: mod_spatialite library has been upgraded to version 4.3.0a.


  • Added: New editor for CartoCSS projects.
  • Added: New dialog that shows details about project loading.
  • Added: Menu item File->Export->Export Map Styles...;
  • Improved: WelcomeScreenForm provides a list of recent projects with preview.
  • Fixed: Application can not be launched by using the newest VC++ Redistributable package v14.0.23918.
  • Fixed: The project name (window title) is taken from a Carto project, not from the file name.
  • Fixed: Fixed a crash when a textbox with latitude/longitude contains an incorrect decimal separator value in GoToLocation form.


  • Upgraded: The installer requires .NET Framework 4.6 to be installed.


We are planning to spend next few months on making this release more stable. Next, we might add full support of vector tiles (see MapBox or osm2vectortiles providers). Thus, one could add this data source as a group layer and consider all its advantages respectively. Furthermore, we continue working on an extension for CartoCSS language to utilize a rich set of features that make MapSurfer.NET unique in its genre. Among them are text abbreviation, collision measures, quality metrics or a dozen of label placement types (e.g, PeakPointPlacement, CurvedPointPlacement, HorizontalOutsidePolygonPlacement). These are just few examples and if you want to learn more about all available features, we refer to the documentation available on GitHub.

We are pretty sure that this release and future plans will open up new possibilities for cartographers and GIS specialists to build fast and amazingly beautiful maps using MapSurfer.NET.
Stay tuned!

We are looking forward to your feedback which you can give in the following places:

Share this:


comments powered by Disqus