Load geojson with EPSG 4978 coordinates

Hello,

Is it possible to load some geojson files with EPSG4978 coordinates into CesiumJS ?
I tried to but without success.

@Julien

Welcome to the community! :grinning: :globe_with_meridians:

I am going to check in with the rest of the CesiumJS development team and get back to you ASAP with an answer. I appreciate your patience.

-Sam

@Julien

To the best of our knowledge GeoJSON does not support EPSG:4978. With GeoJSON, the format is always longitude, latitude, (height) - which is EPSG:4979 if the height is included.

For more information, please check out: rfc7946

-Sam

Hi there,

The easiest way to deal with different coordinate systems in Cesium is to use Proj4.js. For your specific problem I would load it (just file Fetch and JSON unserialize), pass all coordinates through proj4 and convert them into a new GeoJSON structure, and then hand that over to the Cesium API.

The Cesium world is in WGS84 / EPSG4326, so any incoming data needs their coordinates converted first, and Cesium out of the box hasn’t got that in the core, that’s why you got Cesium Ion, 4DMapper and other similar frameworks to do all that persky data conversion and processing for you (at a cost or token, mostly) before sending the processed data off to Cesium JS.

Cheers,

Alex

1 Like

Hi everyone,

Thanks for your answers and explanation.
My main issue is that I want to avoid as much as possible coordinates conversion which lead to some loss of precision in the coordinates.
For this kind of computation, I’m using QGis (which, I believe, is using proj4 or Gdal).
And I was able to create some GeoJson files projected in EPSG4978. But according to the link given by Sam, it is not “standard” Geojson.
I will have a look to the CZML format wich maybe is better for my case.

Cheers,

Julien.