Babylon loads esri shape /geojson

is there a way to load shape (.shp) file or equivalent geojson file, like a heightmap? the purpose is to get the borders of the shape, to map it from lattiude/longitude system to screen XYZ system. any helps would be appericiated!

Maybe Integrate With CesiumJS?

Looks like CesiumJS supports geojson.

Thank you HiGreg - haven’t touch down with cesium/three but this defiantly a possible solution. I will try this later.

Hello, welcome!

Since there is no loader for it in babylon.js and GeoJSon format is quite simple I suggest you to write your own parser. :see_no_evil:

This (roll your own) may be the way to go for basic visualization for small areas away from the poles.

Here’s a link relating to countries on a sphere in BABYLON.

Your approach will likely depend on how big an area you’re trying to visualize. Use the above of you’re mapping the earth on a sphere. Use WGS84 = X,Y if you’re displaying a city block.

For other applications, some of the following might be helpful.

Here is how you can transform WGS84 coordinates into spherical coordinates.

For other projections, like various 2d projections, here is a javascript library that can transform geographic coordinates to different projections.

Here is a brief discussion of errors in coordinate systems relative to the size of the area being mapped.

For reference, if you assume WGS84 coordinates are equivalent to X, Y coordinates, you are effectively implementing an equirectangular projection, most likely a plate carrée projection.

Nice - thank you for detail solution. actually I have a small area of shape (a small river between 2 mountains) to show, it’s wgs 84 coordinates system. I am trying cesium way to parse the shape file to screen xyz and hopefully it compatible to babylon system.