Open yaras-phoenix opened 1 week ago
Does it work if in QGIS you use Cartesian instead of Ellipsoidal?
Does it work if in QGIS you use Cartesian instead of Ellipsoidal?
I work in EPSG:3857 Pseudo-Mercator so cartesian gives me irrelevant 3385 meters. If I change QGIS CRS to, let's say, WGS_1984_Complex_UTM_Zone_30N (ESRI:102580), Cartesian measurement on this object gives 2000.00 meters.
Anyway, it is nowhere near the difference mentioned above.
By the way, using Turf.js I measured distance between [ -5.280356221393128, 53.86928337707964 ] and [ -5.249963734890388, 53.869857228664557 ] and got ~1993.65 meters. This seems like something very close to what I see. Can this be any helpful?
using Turf.js I measured distance between and got ~1993.65 meters.
Yes, I believe that is the difference you see.
Is there a way to avoid this behaviour when 2d and 3d object differ in size in Deck?
What exactly is the bug you are reporting here? The GeoJSON you supply is smaller than the mesh and the rendering result is true to the data.
The problem is that every desktop GIS I use measures this object at ~2000.25: QGIS, GeoMedia, ArcGIS. And when it is published using Deck, I get 1993.5.
Trying to go deeper I found a clue in Postgis docs. There are 2 functions there: ST_DistanceSphere and ST_DistanceSpheroid. They give me the same difference (1993.65745225 and 2000.2556515777933 respectively) and they relate to slightly different world spaces.
It seems desktop GIS applications work with spheroids and web applications work with spheres so the same data gives different result. But 3D model in the scenegraph layer was generated in different, cartesian environment.
So my question would be: is it possible to somehow bring all my data into line so they would be the same on the deck map?
@yaras-phoenix Your model data in 3D tiles might be in meter offsets where each tile has a lng/lat anchor. You could try to hook into the tile loading and use something like @math.gl/proj4
to reproject that anchor from spheroid to spherical coordinates or vice versa. It would likely take you a bit of fiddling to figure out where and how to hook in and which coordinate systems to use in the reprojection and how to specify them.
More precisely the lng/lat anchor is probably calculated by loaders.gl from the WGS84 world centric coordinates, you might also be able to access the WGS84 "anchor" coordinates in the loaded tile and reproject directly from those.
Description
Flavors
Expected Behavior
No response
Steps to Reproduce
Using codepens from deck.gl GeoJSON layer and Scenegraph layer docs made my own here. Links to sample objects (JSON and GLB) are attached in the code.
Environment
Logs
No response