hi everyone, i have a question i have data in coordinate form as below, how to convert it to lat/long? "geometry": { "type": "Point", "coordinates": [ 595389.23369999974966, 2321289.57289999909699, 0.0 ] }
You could try Proj4JS. This is not something CesiumJS does.
Hello,
I understand that you want to convert [ 595389.23369999974966, 2321289.57289999909699, 0.0 ]
to lat/lon coordinates. That depends on a couple of things:
- What coordinate system are those coordinates in? For example, EPSG:4978?
- What ellipsoid would you like latitude and longitude of? Typically this is WGS84, which is captured by the coordinate system EPSG:4979
If those coordinates indeed are in EPSG:4978 and you indeed want the cartographics on the WGS84 ellipsoid, then Cesium can help. Cesium uses the class Cartesian3 to represent points in EPSG:4978 and Cartographic to represent points with lat/long coordinates (defaulting to WGS84 ellipsoid, which means EPSG:4979). You can use the function Cartographic.fromCartesian to convert to lat/lon.
const xyzPoint = new Cesium.Cartesian3(595389.23369999974966, 2321289.57289999909699, 0.0);
const latLonPoint = Cesium.Cartographic.fromCartesian(xyzPoint);
Sandcastle that prints the result to console. Let us know if that helps!
Sincerely, Erixen
Hi, thank for your support, i checked again
Itβs EPSG:32648 and i want the cartographics on the EPSG:4326 WGS84 ellipsoid, can you show me how to do?
Hi @MrSimple,
there was a similar question in the following topic: Convert Northing/Easting
As @scottUFR already stated you can use proj4js for that. There is a code snipped you can change a little bit for your needs in the linked topic.
Best, Lennart