Skip to content

Transform <Polygon> entities from KML into their 'mask' (inverted polygon) equivalents.

Notifications You must be signed in to change notification settings

vasile/Mask-KML-polygons

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 

Repository files navigation

Transform KML polygons in their 'mask' equivalent entities. 
For each <Placemark>:
- an universe rectangle(polygon) that covers the studied area is created.
- all the previous inner boundaries (holes) become stand-alone polygons and forces a <MultiGeometry> to be created
- the previous outer boundary become a hole in the universe polygon created

Usage example:
$ xsltproc invert.xsl cantons.kml > cantons_inverted.kml

If you want to customize the masking area, use 'mask' via --stringparam:
$ xsltproc --stringparam mask '-25,15 40,15 40,80 -25,80 -25,15' invert.xsl cantons.kml > cantons_inverted.kml

The attached 'cantons.kml' is generated from Swisstopo GG25 dataset.
http://www.toposhop.admin.ch/en/shop/products/landscape/gg25_1

For a demo output check this Swiss boundaries map integration (Google Maps, Google Fusion Tables)
http://www.vasile.ch/hacks/ft-mask/

About

Transform <Polygon> entities from KML into their 'mask' (inverted polygon) equivalents.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published