Example: Create 3D pie charts in KML
Goal
Using a shapefile of country boundaries, create a KML file
showing 3D pie charts of statistics for each country.
For this example, the counts of orthographic classification (i.e. vowel/consonant)
of the letters in country names is used. This is obviously contrived,
but does illustrate JEQL's rich character processing facilities.
Input
Shapefile containing country boundary polygons
(in geographic coordinate system) and country name.
(Obtained from geocommons.org).
Script
namePieKML.jql
- Input country boundary polygons and names are read from shapefile
- Country polygons (or in the case of multipolygons the largest one)
are used to determine interior point and radius of pie
- Counts of name letter classifications are computed for vowels and consonants
- Circular arcs are generated for both classifications
- KML styling and labelling is generated from compute table of geometry and statistics
Output
Output KML file
- Pie sections show number of vowels and consonants in
country name.
- Pies are placed at an interior point in the country,
and are sized so that they lie wholly within the country.
- Pie height shows total length of country name
- Pie sections are extruded for 3D effect
- Pie sections are color-themed
- Output is automatically compressed into KMZ file.