VMAP0 polbnda layer in shapefile format

Last data update: September 30, 2012

Last page update: March 20, 2016

 

This page describes the construction of a shapefile containing the polbnda layer of VMAP0.

The first step is the conversion of the VMAP0 data to a shapefile, polbnda.shp. Next, a number of topological and data errors are fixed, resulting in polbnda1. Next, the artificial division of polygons on 15° lines is removed, resulting in polbnda2. Some artifacts are removed by manual editing, resulting in polbnda3 (zip, sha1). polbnda4 (zip, sha1) is an alternative version where the mouth of the St Lawrence is not treated as in-land water.

Initial conversion to shapefile

The initial conversion of the VMAP0 data to a shapefile has been performed using OGR, following the procedure described here.

Correction of topological errors

A number of topological errors are revealed by OpenJump’s layer validation function.

There is a ring intersection at -47.30509948730469,-16.038990020751953, in Brazil. In the VMAP0 data, the Goiás state, the Minas Gerais state and the Distrito Federal all meet at that point. The polygon for the Goiás state is a polygon without hole, going around the Distrito Federal, so it passes twice by that point. The fix is to make the Distrito Federal a hole in the polygon for the Goiás state.

Another ring intersection is at 27.891361236572266 71.04125213623047, in Norway. The fix is to remove the vertex at that point.

The remaining errors are extraneous vertices which are apparently artifacts of the way this layer was created (they are not present in the poldbnl layer). The fix is to remove them.

Finally, repeated points are removed using Michaël Michaud's beanshell script.

Correction of data errors

The polygon for Dundgovi (Mongolia) erroneously includes the part of the Ovorhangay below 45° N. The fix is to split the polygon for Dundgovi (between the two closest vertices), and to merge the appropriate part with the polygon for Ovorhangay.

Sawfajjin in Libya is incorrectly represented. There are four polygons for this area. The two northern ones are correct; the south-eastern one is incorrectly labelled Gharyan; the south-western one is actually merged with the southern polygon of Gharyan. The fix is to split the southern polygon for Gharyan, and to reassign the eastern piece of the split as well as the south-eastern polygo to Sawfajjin.

Removal of 15° grid

In the VMAP0 data, the features have been intersected with a grid at 15° steps. This step is removes this tiling, by dissolving the features on the names.

This transformations is performed via this script; polbnda1 is the shapefile after correction of the errors above, polbnda2 is the shapefile after dissolving:

shp2pgsql -S -d -g geom -i -I "polbnda1" polbnda1 \
  | sed -e "s_\\\'_''_g"  \
  | iconv -f ISO-8859-1 -t utf-8 \
  | psql.exe -o polbnda1.log

psql.exe -e <<EOF
DROP TABLE polbnda2;
CREATE TABLE polbnda2 (gid serial PRIMARY KEY,
   f_code       varchar(5),
   nam          varchar(64),
   na2          varchar(2),
   na3          varchar(1));
SELECT AddGeometryColumn('','polbnda2','geom','-1','POLYGON',2);
INSERT INTO polbnda2 (f_code, nam, na2, na3, geom) 
   SELECT f_code, nam, na2, na3, h as geom FROM (
       SELECT f_code, nam, na2, na3, geom (dump (g)) as h FROM (
           SELECT f_code, nam, na2, na3, geomunion (geom) as g
           FROM polbnda1
           GROUP BY f_code, nam, na2, na3)
       as x)
   as y;
EOF

pgsql2shp -g geom -f "polbnda2" polbnda2

In some cases where an area has been split into two polygons by a 15° line, the representation of the common “side” of those two polygons is not exactly the same in those two polygons. After merging them, we end up with an artifact in the form of a small hole in the merged polygon. Those have been removed by manual editing.

Fixing the St Lawrence

Much of the mouth of the St Lawrence (Quebec) is considered in-land water area by VMAP0. Resulting maps are not very pleasing to look at, so we produced an alternative, polbnda4, by removing that in-land water area from the landmass.


Terms of use

CC0 To the extent possible under law, Eric Muller has waived all copyright and related or neighboring rights to this page and the maps it presents. This work is published from the United States.

Note that this does not affect the rights other persons may have in those files. I am not qualified to determine whether such rights exist.


Contact - Thanks

History: