Visualizing 3D geojson in threejs

I have a 3D GeoJSON of a 3D city model. I want to display it in Three.js, but it does not support this format.
Is there a method or plugin that can load the 3D GeoJSON in Three.js? Below is the file I am working on.

geojson4326.geojson (9.0 KB)

Here are a few options:

  • option 1: search the web (usually GitHub) for a library that loads 3D GeoJSON into Three.js object. I hope there are several such libraries, although some of them might be outdated or might not support the full standard
  • option 2: write a loader by yourself – this might not be easy or quick to do
  • option 3: if your data uses a very limited set of GeoJSON functionality, you can write a code to convert it into Three.js objects

For example, when I try the third option I get this from your file (no idea whether it is correct):

Thank you for your help:

For option 1: I have already tried several solutions on GitHub, but I haven’t found any code that supports rendering 3D GeoJSON with 3D coordinates like my file. They are based on generation by extrusions. If you find one, could you please let me know?

For option 3: This GeoJSON is extracted directly from the database. Could you give me a simple example of a 3D GeoJSON that can be converted into a Three.js object so that I can adapt my query to be compliant with the format?

Thank you.

1 Like

I don’t work with GeoJSON, so I don’t know any good library.

For option 3 I used your GeoJSON file geojson4326.geojson, put it in the a web page, extracted the data and visualized them. Note, that the programming code is only for this file, a kind of proof-of-concept that in some cases you can write own simple loader instead of looking for some complex but universal loaded.

Here is the code (the JSON file is in line 42, my primitive loader is in lines 51-63):

Thank you for your help. I think this will not work with 5000 features.
I’ll try to convert the 3D GeoJSON to another format like 3D Tiles if that is possible.