Skip to content

ElmarJ/GeoJsonCityBuilder

main
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

GeoJSON City Builder

OpenUPM version GitHub issues

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 3D project.

Installation

Option 1: Using OpenUPM cli

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.

  1. Click Window -> Package Manager
  2. Click + -> Add Package from git URL
  3. Type https://github.com/ViRGIS-Team/GeoJSON.Net and click Add
  4. Type https://github.com/ElmarJ/GeoJsonCityBuilder and click Add

Usage

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).

Blocks from geojson polygons

  1. Create an empty GameObject
  2. Click Add Component and add Scripts/GeoJsonCityBuilder/Position on World Coordinates
  3. 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).
  4. Click Add Component and add Scripts/GeoJsonCityBuilder/Blocks From Geo Json
  5. Drag your geojson-file into "Geo Json File". Make sure it has a ".json"-extension; ".geojson" will not work.
  6. Set other settings and materials
  7. Click Generate

Prefabs from geojson polygons

  1. Create an empty GameObject
  2. Click Add Component and add Scripts/GeoJsonCityBuilder/Position on World Coordinates
  3. 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).
  4. Click Add Component and add Scripts/GeoJsonCityBuilder/Blocks From Geo Json
  5. Drag your geojson-file into "Geo Json File". Make sure it has a ".json"-extension; ".geojson" will not work)
  6. Drag your prefab into "Prefab"
  7. Click Generate

Open source credits

This package makes use of the JSONObject library by Matt Schoen

Links

Links kept for reference to similar or otherwise relevant projects:

About

Unity Package to recreate a 3D-city from a specially crafted geojson file.

Topics

Resources

License

MIT, Unknown licenses found

Licenses found

MIT
LICENSE
Unknown
LICENSE.meta

Stars

Watchers

Forks

Sponsor this project

Packages

No packages published

Languages