streetscape.gl
streetscape.gl copied to clipboard
Polylines are distorted in Streetscape compared to other Visualization tool like Kepler or Geojson.io
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

Same visualization looks quite smooth in Kepler.gl as below

However when I visualise same line in streetscape.gl it seems to far more distorted as below

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 ?
@twojtasz any thoughts about this issue/ behaviour
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 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.
Yes I m using JSON format . should I move to GLB ?
I moved to GLB dont see any difference .. Could it be that AVS supports higher resolution than Kepler and other frameworks?
@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
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.
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
Both JSON and glb are parsed using the xviz parser before streetscape.gl consumes them.
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 ?