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
  1. Input country boundary polygons and names are read from shapefile
  2. Country polygons (or in the case of multipolygons the largest one) are used to determine interior point and radius of pie
  3. Counts of name letter classifications are computed for vowels and consonants
  4. Circular arcs are generated for both classifications
  5. KML styling and labelling is generated from compute table of geometry and statistics

Output

Output KML file