Comments (3)
Hi Ram,
I know this has been raised before, but I need to join a table container 25 million trip records to a geography table whose geometries are multi-polygons and metadata about the country and states. Currently since multi-polygons are not first class udfs. I'm wondering what would be the most efficient way to handle a join that would aggregate trip counts by geography name using the "$"start_point" within $"polygon"" predicate.
Currently, I've created a dataframe that contains a Seq[Polygons]:
case class Geography(geography_id: String,
geography_name: String,
geography_type: String,
region: String,
polygons: Seq[Polygon]
)
In postgis, this looks like:
select date_trunc('hour', startts) AS hour, g.region, g.type, g.name, t.provider_id, count(trip_id),
from trips t, map.geography g where st_intersects(t.startloc, g.geom)
group by 1, 2, 3, 4, 5
Not sure how best to handle this in spark where g.geom is a multi-polygon.
Also is there a spatial index that is created on the smaller table (in this case geom), to make the query more efficient?
Thanks,
Trang
from magellan.
👍
from magellan.
done! We have support for multipolygons now in #123
from magellan.
Related Issues (20)
- How to debug index usage crashes? HOT 6
- Guava StopWatch use causing dependency issue
- Broadcast Timeout on Ontario GeoJson boundary
- WKT parser problem HOT 3
- Snapshots available? HOT 1
- Problem while converting coordinates to point in Spark 2.3.1 and Scala 2.11 HOT 3
- Cannot perform join between points and polygon using Scala 2.11 and Spark 2.3.1 HOT 9
- Cannot imort magellan.coord.NAD83
- What does this work with? HOT 5
- obtaining a list of geohashes representing neighborhoods zones HOT 2
- Next Release HOT 1
- How to run the NYC Taxicab analysis notebook with Azure DataBricks HOT 3
- Point not found when injectRules used HOT 4
- Issue with checking point within polygon
- Magellan on DataBricks Community Edition? HOT 2
- Tutorial Issue finding 'point' HOT 2
- Add Support for Spark 2.4.3 and above
- Python Support
- NoClassDefFoundError
- Empty metadata while reading data from shape file or geojson file
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from magellan.