Archief

Cartography

Former Antilles, congratulations!

October 10 2010 (10-10-10) is a historic date, it is the day the “De Nederlandse antillen” seize to exist. Today St. Maarten and Curaçao become autonomous countries with in the “Kingdom of the Netherlands”. Bonaire, St. Eustatius and Saba become municipalities of the Netherlands. A special kind of municipalities, not all rights and assets common to municipalities in the Netherlands will be available to these beautiful islands.

The Dutch OpenStreetMap community focuses on the small piece of land geographically located between the North sea, Germany and Belgium, but a lot of dutch people are somehow connected socially or otherwise to the (former) antilles. I have been an enthusiastic mapper for OpenStreetMap for years mainly busy mapping Aruba. I am curious if others are putting similar effort in mapping the other islands. Therefor I am constantly looking for help and geodata in that particular, extraordinary beautiful region of the world.

Aruba

Two years ago, I received geodata for Aruba last updated in 2005. The data originates from CAD-drawings and was cut-up in what looks like paper-sheet format for large print/plot. Besides that, the data consists of line-work only.

The data is outdated. Beside that, lines are “messy” with a lot of over- and undershoots, disconnected or missing chunks. Automated imports are strongly discouraged. The geodata does not contain any names or labels, making it almost impossible to create addresses and streetnames unless you have been to Aruba or are living on Aruba. What I did, is make the Aruba dataset available as a WMS server, hoping to atract people from the island to join me in mapping it. The WMS server runs on the dogomaps domain. A simple demo can be viewed here.

wms.png

Using the WMS service

For Merkaartor, you can point the WMS adapter to:

http://www.dogomaps.net/geoserver/wms?

When you use this link correct, Merkaartor will detect the available layers. The best layer to pick would be the one labeled “Aruba” because it joins all the other layers in to one and thus limits the traffic to the server.

In JOSM you can set up the service URL:

http://www.dogomaps.net:80/geoserver/wms?SERVICE=WMS&FORMAT=image/jpeg&VERSION=1.1.1&SERVICE=WMS&REQUEST=GetMap&Layers=aruba& .

The WMS url for retrieving the GetCapabilities is:

http://www.dogomaps.net/geoserver/ows?service=wms&version=1.1.1&request=GetCapabilities

I hope this initiative will encourage others to help me enhance OpenStreetMap for Aruba and hopefully we can set up a good example for the other former antilles to follow.

I want to congratulate all the people on the islands with there new “freedom”, hope they celebrate and party and wish them a prosperous future!

A couple of years ago, I was asked to help making a geodataset available in Google Earth.

The data

I recieved a geodataset of Aruba. This dataset was in MapInfo file format and in a projection I could not in any way reproduce. The funny thing was that the authorities providing me with the data didn’t have a clue about how to reproject the data either. The data wasn’t real GIS data, but was derived from Autocad drawings, resulting in linework without topology, with unclosed polygons and poluted by invalid geometries.

Projection

I decided to post a question to the proj mailing list on april 4, 2007. Shortly after that I recieved a response from Clifford J. Mugnier, C.P., C.M.S. National Director of the Photogrammetric Applications Division at ASPRS. It turned out the ASPRS had done a lot of surveying throughout the years to “recover” projections that are local and often not commonly used and often not documented. The ASPRS has a large collection of projections in the Grids and Datums section on their website. Aruba and the Netherlands Antilles had been surveyed and documented in july 2002 and reading through the documentation, I defined these projection parameters:

+proj=tmerc +lat_0=12.51697 +lon_0=-69.994775 +k=0.9996 +x_0=10000 +y_0=15000 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs

I took some small samples of the data and tested conversion with ogr2ogr. In general the reprojection was acceptable, this was hopeful! I decided to create a linux batch to reproject all the data, meanwhile also transforming it to ESRI shapefile so I could easily load it into postgis. When the batch was finished, I transfered the data to one of my servers opened a terminal and started uploading to postgis. When the process was finished, I had over 200 tables.

Merging data

The geodata for Aruba was created in AutoCad and, as you often find with historic geodata, split in sections targeted at creating large scale paper maps.

When I ran the first test with geoserver, I didn’t like the fact that the data didn’t connect. It also caused me way to much maintenance to assign styles to all these tables. I also noticed that all the AutoCad symbols where converted to linework too and that not all data was assigned to the correct layers making it nearly impossible to create a good looking online map.

I decided to merge tables based upon the type of geometry: point, linestring or polygon. And for the symbols, I set up a table containing symbols only. During the merging process, I added the “source” to every object containing the original filename and therefor providing information about the section and the original AutoCad layer. And from this information I extracted the “layer” property so I could later on thematically color/style my map based upon the layer attribute.

Presentation

Once the process of merging data was finished, I set up geoserver to serve the data as WMS. For this I first added a workspace called “aw” then I connected my database to geoserver. Finally I added the 3 remaining, relevant tables as layers.

Then I set up the SLD to color my layers for better readability. In geoserver I set up a Layer Group called “aruba” and tested this through the geoserver layer preview interface. I now have an online map of Aruba!

A while ago I was asked to help in getting data from the OpenStreetMap database to create special maps for parcs/greens in the four major dutch cities.

Required:

Access to a postgresql database with the postgis extension, often the result of an osm2pgsql import.

All parcs in then Benelux to shape:

pgsql2shp -f parken -h <host> -u <username> <database> “select osm_id, leisure, “name”, transform(way,28992) as way from planet_osm_polygon where leisure=’park’”

A couple of important notes:

  • Because I need my data to be in the Dutch National Coordinate system, I will translate the data when exporting. Of course you can use any postgis supported coordinate system here.
  • Not all attributes for the objects are required. With the subset osm_id, leisure en “name” I limit the result.
  • -f parcs will create parcs.shp, parcs.shx, parcs.dbf and parcs.prj.

Al the waterbodies and waterways in the Benelux to shape:

(Because only parcs won’t create a readable map, I also extract some enhancing data)

pgsql2shp -f water -h -u   “select name, transform(way,28992) as way_rd from planet_osm_polygon where “natural”=’water’”
pgsql2shp -f waterwegen -h  -u   “select name, transform(way,28992) as way_rd from planet_osm_polygon where not waterway is null”

As with the previous statements, I again limit the returned attributes. The column natural is a reserved word in postgresql SQL syntax, that is why it needs to be quoted.

Getting the contours of our four major cities:

pgsql2shp -f amsterdam -h  -u   “select name, transform(way,28992) as way_rd from planet_osm_polygon where name=’Amsterdam’”

pgsql2shp -f rotterdam -h  -u   “select name, transform(way,28992) as way_rd from planet_osm_polygon where name=’Rotterdam’”

pgsql2shp -f denhaag -h  -u   “select name, transform(way,28992) as way_rd from planet_osm_polygon where name=’Den Haag’”

pgsql2shp -f utrecht -h  -u   “select name, transform(way,28992) as way_rd from planet_osm_polygon where name=’Amsterdam’”

Now let’s do Magic!

After creating all these shapefiles, I start qGIS, in my case qGIS 1.1.0. First I load all the shapes, giving me a layer per shapefile. This results in a random color scheme and layers in a random sequence [1]. I shift the layers and change the color schemes to my wishes [2]

Clip

The next thing that needs to be done is clip all the parcs and water based upon the boundaries of the cities. For this I use a qGIS toolset -> Geoprocessing tools -> clip. It is also possible to clip with the extract statement, but doing this visually enabled with qGIS gives me more control and is faster too. The result is [3]

Export as SVG

Finally I use an important feature of qGIS that prepares my map-image for post-processing; export as svg. For this you open the print composer (CTRL+P), add my mapview to the composition with “Add New Map”, position it and press the fourth button in the print composer: Export as SVG.

I have put the result online [4] for download so you can edit it in your favorite vector-graphic program, in my case this will be inkscape.