Convert GeoJSON Polygons into Meshes for Unity with Triangle (Delaunay Triangulator)
- Triangle
- node
- bash
- Place a file
input.geo.json
which contains a GeoJSON. - Run the following command:
./run.sh
- You will find two new files
output.unity.json
which contains all triangles and vertices ready to be read into unity andoutput.geo.json
which contains all triangles as a GeoJSON.
{
"type": "FeatureCollection",
"features": [
{
"type": "Feature",
"properties": {},
"geometry": {
"type": "Polygon",
"coordinates": [
[
[0, 0],
[0, 1],
[1, 1],
[1, 0],
[0, 0]
]
]
}
}
]
}
Add more features with geometry type "Polygon" into the "features" array.
View the input/output on geojson.io and read your output into any programming language with quicktype.