mistercrunch commented on a change in pull request #4134: [Geo] Added DeckGL
Arc Layer
URL:
https://github.com/apache/incubator-superset/pull/4134#discussion_r160802968
##########
File path: superset/viz.py
##########
@@ -1818,21 +1819,54 @@ def get_position(self, d):
d.get('lat'),
]
+ def process_spatial_query_obj(self, key, group_by):
+ spatial = self.form_data.get(key)
+ if spatial is None:
+ raise ValueError(_('Bad spatial key'))
+
+ if spatial.get('type') == 'latlong':
+ group_by += [spatial.get('lonCol')]
+ group_by += [spatial.get('latCol')]
+ elif spatial.get('type') == 'delimited':
+ group_by += [spatial.get('lonlatCol')]
+ elif spatial.get('type') == 'geohash':
+ group_by += [spatial.get('geohashCol')]
+
+ def process_spatial_data_obj(self, key, df):
+ spatial = self.form_data.get(key)
+ if spatial is None:
+ raise ValueError(_('Bad spatial key'))
+
+ if spatial.get('type') == 'latlong':
+ df = df.rename(columns={
+ spatial.get('lonCol'): 'lon',
Review comment:
Aren't names conflicting here when there are multiple spatial controls? For
that reason I think it'd be ideal to use the key as the column name in the
dataframe, and store a tuple with lat & long as the value.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services