visgl / deck.gl

WebGL2 powered visualization framework
https://deck.gl
MIT License
12.24k stars 2.08k forks source link

Aggregation layers should accept multipoint geometry or simple list of 2-tuples #4530

Closed andybak closed 4 years ago

andybak commented 4 years ago

Target Use case

Avoid unnecessary transforms on the server-side

Proposed feature

Aggregation layers should accept multipoint.

i.e. in addition to the current format:

 [
 {COORDINATES: [-122.42177834, 37.78346622]},
 ...
 ]

it could also accept geojson such as:

 { "type": "MultiPoint", "coordinates": [ 
    [ -0.07230637276332, 51.392841756739863 ],
    ...
 ]}

or even just the inner coord array:

 [
 [-122.42177834, 37.78346622],
 ...
 ]

I suspect this is a more natural output format to generate server-side. I can't figure out a way to generate the existing format in GeoDjango without iterating in Python or writing an SQL query that does string formatting.

Also - it's more compact.

andybak commented 4 years ago

Ha! I just checked the examples and I was mistaken. The import format is flexible as you can put whatever you want in getPosition...

In which case I think this is a documentation problem (or a problem with my brain).

On https://github.com/visgl/deck.gl/blob/master/docs/layers/hexagon-layer.md

I read the part near "Data format:" to imply that the data format was fixed and had to be in this format. Maybe simply removing the words "Data format:" or phrasing it as "Example Data format:" would be better?

Feel free to close this if you think I'm just especially dumb.

andybak commented 4 years ago

The more I think about it, the stupider this seems. I'll close this. :)