streetscape.gl icon indicating copy to clipboard operation
streetscape.gl copied to clipboard

Polylines are distorted in Streetscape compared to other Visualization tool like Kepler or Geojson.io

Open amolskh opened this issue 6 years ago • 10 comments

I am trying to visualize below Geojson in Streetscape.gl { "type": "FeatureCollection", "features": [ { "type": "Feature", "properties": { "stroke": "#FFFF00", "stroke-width": 2, "stroke-opacity": 1 }, "geometry": { "type": "LineString", "coordinates": [ [ -117.1365798525, 32.8932626536, 0 ], [ -117.1365903505, 32.8932577329, 0 ], [ -117.1366009332, 32.89325346, 0 ], [ -117.1366109529, 32.8932490706, 0 ], [ -117.1366214774, 32.8932444199, 0 ] ] } } ] }

I am generating my visualization using Xviz. However polyline looks more zigzag compared to other tools (Kepler, Geojson.io)

Same visualization looks very smooth in Geojson.io as below Screenshot Capture - 2019-08-22 - 19-33-26

Same visualization looks quite smooth in Kepler.gl as below Screenshot Capture - 2019-08-22 - 19-33-26

However when I visualise same line in streetscape.gl it seems to far more distorted as below Screenshot Capture - 2019-08-22 - 19-43-33

I have observed same behaviour across many polylines.

Is this issue in streetscape.gl implementation? or any config that I need to configure.? Or are other visualisation tools doing any kind of processing that makes line appear more smoother than in case of streetscape.gl ?

amolskh avatar Aug 22 '19 14:08 amolskh

@twojtasz any thoughts about this issue/ behaviour

amolskh avatar Aug 25 '19 13:08 amolskh

This might be due to xviz parser packing positions into a Float32Arrray. Most of our data is vehicle relative. Lnglat positions would lose precision in 32 bit.

Pessimistress avatar Aug 25 '19 14:08 Pessimistress

@Pessimistress does this happen in the parser or the builder? Wondering if he used the JSON format over the GLB format if that would change the outcome.

twojtasz avatar Aug 26 '19 15:08 twojtasz

Yes I m using JSON format . should I move to GLB ?

amolskh avatar Aug 26 '19 16:08 amolskh

I moved to GLB dont see any difference .. Could it be that AVS supports higher resolution than Kepler and other frameworks?

amolskh avatar Aug 26 '19 16:08 amolskh

@amolskh hmmm, I would have to test to verify. I am surprised the JSON path is not working.

Most data we have dealt with so far has been, as was mentioned above, vehicle relative. You could GeoJSON at the streetscape.gl level. There is an example of this in the get-started application in the branch tpw/custom-geolayer

You can see the changes here: https://github.com/uber/streetscape.gl/commit/739501ee8013a9ced0b51d9478ad65857cd0c531

twojtasz avatar Aug 26 '19 20:08 twojtasz

This is an issue in both builder and parser.

@amolskh since you are using JSON, you should not be affected by the builder issue. I can patch the parser fairly quick.

@twojtasz the builder issue is more tricky to address. We can of course just switch the binary packing to use Float64Array, though that would significantly inflate frame size if people are relying on it to pack point cloud geometries. Otherwise we need to generate either Float64Array or Float32Array based on the stream's coordinate system.

Pessimistress avatar Aug 26 '19 20:08 Pessimistress

I am not sure if this fix is real issue . Because in order to test I pasted same lat long in direct json generated. So Xviz parsing dosent come into play. I simply edited json file created post xviz manually and put the coordinates

amolskh avatar Aug 28 '19 02:08 amolskh

Both JSON and glb are parsed using the xviz parser before streetscape.gl consumes them.

Pessimistress avatar Aug 28 '19 02:08 Pessimistress

Ok thanks I will try to test it .. Is this merged into master main release or do I need to take any specific version or using streetscape 1.0 release will work for me ?

amolskh avatar Aug 28 '19 10:08 amolskh