Introduction
The original vector datasets used by Karttur’s GeoImagine Framework for default regions, including countries and continents, are of a very high spatial accuracy. The original data was preprocessed by Karttur to remove all errors (slivers), and is available from Karttur’s web-site (not from the GitHub repo). The vector data over countries, subcontintents, continents and countries divided into continental parts, available at Karttur’s GitHub repo are simplified versions of the original. Two simplified versions are included with the Framework GitHub repo, where the layer (shape file) last name component denotes the tolerance applied when creating the files:
- “spatial-feature”_karttur_global_2014_tol@100m.shp: 100 m tolerance
- “spatial-feature”_karttur_global_2014_tol@1km.shp: 1 km tolerance
This post outlines how the vector data supplied with the Framework GitHub project was created. The process used for simplifying the vectors can be applied to any other (line or vector) dataset imported to the Framework.
Prerequisites
You must have completed the previous post on setup process.
OrganizeAncillary
The process for importing Ancillary vector data to the Framework is OrganizeAncillary. The vector simplification integrated with the process is controlled by four parameters:
- tolerance (float),
- angletolerance (float),
- quadrangle (boolean), and
- checkfixvalidity (boolean).
The simplification is controlled by the combined setting of the first three parameters while the fourth (checkfixvalidity) determines whether to validate and fix the topology or not (default is set to true and thus perform the validity check and fix).
Skip simplification
To skip the simplification set tolerance and angletolerance to 0 and quadrangle to false. The imported vectors will still be validated for topological consistency and corrected, unless also checkfixvalidity is set to false.
Quadrangle simplification
quadrangle is a special simplification algorithm developed for 4-cornered polygons that have vertices in addition to the 4 corners. It was specifically developed for correcting the Landsat WRS polygons. To work, you must set quandrangle to true and set a value for tolerance > 0.
The quadrangle algorithm first creates a rectangular boundary. In theory the 4 corners of any quadrangle intersect with the boundary. If the quadrangle is not a rectangle (but a parallelogram) the four corners will be identified directly. If, however, one or more sides is horistontal or vertical (e.g. at the international date line for Landsat WRS polygons), there might be multiple vertices identified. To distinguish between the corner vertices and other nodes, the tolerance value is used.
If quadrangle is set to true it has precedence over teolerance and angletolerance.
Tolerance simplification
By setting the parameter tolerance > 0 (with quadrangle set to false), the process utilises the ordinary (topology preserving) shapely simplify algorithm. The much quicker Douglas-Peucker algorithm for simplification available with shapely is not implemented.
Angletolerance simplification
The angletolerance algorithm is taken from Toblerity GitHub pages. It is intended for simplifying the polygons of regular geometric figures with at least 5 vertices and a surplus of nodes in between.
Simplifying Country and continent vector data
As stated above, the original country and continent data prepared for the Framework is of very high spatial accuracy. The versions supplied with Karttur’s GitHub pages are simplifications, created with the json parameter files under the
buttons below.