May 2019
Beginner to intermediate
650 pages
14h 50m
English
We have already used GeoJSON do draw a world map containing over 200 geometries, but they were all either Polygon or MultiPolygon. Let's try rendering the other types. The simplified GeoJSON file as shown (Data/africa-simple.geojson) contains four different geometry types: MultiPolygon, LineString, MultiLineString and Point, each one inside a separate Feature.
{"type":"FeatureCollection", "features":[ { "type":"Feature", "properties":{}, "geometry":{ "type":"MultiPolygon", "coordinates":[ [[[34,31],...,[34,31]], [[35,-12],...,[35,-12]], [[32,-2],...,[32,-2]], [[29,-4],...,[29,-4]]], [[[44,-25],...,[44,-25]]] ] } },{"type":"Feature", "properties":{ "id":"river1", "name":"Nile" }, "geometry":{ "type":"MultiLineString", ...Read now
Unlock full access