Open xyy94813 opened 2 years ago
Thanks for reporting @xyy94813 . I agree we would need for the reversal to happen before or during parsing. On quick inspection it seems the best solution would be to open a PR on geopy
to add an optional parameter to the Point
constructor so the parser knows to default to latLng
when no directional indicators are provided. This shouldn't be very difficult and would probably benefit the whole geopy
community.
A workaround before it fix.
DB Column is lngLat, ie 112,23
Add new Metric
or Calculated Columns
.
(I still don't understand the difference between the two)
# SQL Expression
split_part(lngLat, ',', 1) # lng
split_part(lngLat, ',', 2) # lat
Then you can use the type Longitude & Latitude
@yousoph Any progress?
Hi @xyy94813 , are you testing on master? I'm seeing this working on master with data that looks like this:
@yousoph
The wrong test case is lng,lat
column, ie -122.428577,37.7806267
.
And
Ah, my bad, we're not currently working on it if you feel up to contributing a fix! 🙏
If anyone reading this wants to review the linked PR, it would be appreciated! Also, I assume this is still present in 3.1/4.0 (the currently supported versions) but confirmation would be appreciated.
Got error when use
deck.gl Scatterplot
with typeDelimited
.How to reproduce the bug
deck.gl Scatterplot
Delimited long & lat single column
110.1926929869672,30.737983766034915
Invalid spatial point encountered
.Reverse lat/long
still got same error.Expected results
Correct show Chart.
Actual results
Got Error:
Screenshots
If applicable, add screenshots to help explain your problem.
Environment
(please complete the following information):
Checklist
Make sure to follow these steps before submitting your issue - thank you!
Additional context
When the type is "delimited",
lngLat
should be converted tolatLng
before "parse_coordinates". Otherwise an illegallat
orlng
will cause an exceptionhttps://github.com/apache/superset/blob/299b5dc64448d04abe6b35ee85fbd2b938c781bc/superset/viz.py#L2510-L2519
https://github.com/apache/superset/blob/299b5dc64448d04abe6b35ee85fbd2b938c781bc/superset/viz.py#L2542-L2551
https://geopy.readthedocs.io/en/stable/#geopy.point.Point