Unity Package to recreate a 3D-city from GeoJSON files. Currently allows to create extruded objects (e.g. buildings) from polygons and to place prefabs on points.
See for an example on what can be achieved and how to use it, the Waterlooplein Time Machine project.
This package is listed in the OpenUPM repository. Installation:
npm install -g openupm-cli
cd YOUR_UNITY_PROJECT_FOLDER
openupm add com.virgis.geojson.net
openupm add nl.elmarjansen.geojsoncitybuilder
Note that this package depends on the geojson package com.virgis.geojson.net being installed.
- Click Window -> Package Manager
- Click + -> Add Package from git URL
- Type https://github.com/ViRGIS-Team/GeoJSON.Net and click Add
- Type https://github.com/ElmarJ/GeoJsonCityBuilder and click Add
See https://github.com/ElmarJ/geojsoncitybuilder.devenv for a simple working example in Unity. See https://github.com/ElmarJ/Waterlooplein3D/ for a more advanced example (using the Unity HDRP pipeline).
- Create an empty GameObject
- Click Add Component and add Scripts/GeoJsonCityBuilder/Position on World Coordinates
- Set the desired Lat/Long-coordinates for the Unity world origin in the "Position on World Coordinates" component (choose a location central to the area that you want to reconstruct).
- Click Add Component and add Scripts/GeoJsonCityBuilder/Blocks From Geo Json
- Drag your geojson-file into "Geo Json File". Make sure it has a ".json"-extension; ".geojson" will not work.
- Set other settings and materials
- Click Generate
- Create an empty GameObject
- Click Add Component and add Scripts/GeoJsonCityBuilder/Position on World Coordinates
- Set the desired Lat/Long-coordinates for the Unity world origin in the "Position on World Coordinates" component (choose a location central to the area that you want to reconstruct).
- Click Add Component and add Scripts/GeoJsonCityBuilder/Blocks From Geo Json
- Drag your geojson-file into "Geo Json File". Make sure it has a ".json"-extension; ".geojson" will not work)
- Drag your prefab into "Prefab"
- Click Generate
This package makes use of the JSONObject library by Matt Schoen
Links kept for reference to similar or otherwise relevant projects:
- ViRGIS (Github): a project to bring GIS data and VR together in Unity.
- BlenderGis: a plugin for Blender to generate objects from GIS-data
- Use Houdini for procedural city building