------------------------------------
Jia Yu,
Ph.D. Student in Computer Science
Reach me via Jia Yu's Homepage | GitHub Repositories
--
You received this message because you are subscribed to the Google Groups "GeoSpark Discussion Board" group.
To unsubscribe from this group and stop receiving emails from it, send an email to geospark-discussio...@googlegroups.com.
To post to this group, send email to geospark-dis...@googlegroups.com.
Visit this group at https://groups.google.com/group/geospark-discussion-board.
To view this discussion on the web visit https://groups.google.com/d/msgid/geospark-discussion-board/77836015-ccd4-415d-895d-2ad894bf9243%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
var polygonDf = sparkSession.sql("select ST_GeomFromWKT(w.geometry) as polygeom, w.* from wkt_table w")
var polygonRDD = new SpatialRDD[Geometry]
polygonRDD.rawSpatialRDD = Adapter.toRdd(polygonDf)
polygonRDD.analyze()
var pointDf = sparkSession.sql("select ST_Point(l.long, l.lat) as pointgeom, l.* from locations l")
var pointRDD = new SpatialRDD[Geometry]
pointRDD.rawSpatialRDD = Adapter.toRdd(pointDf)
pointRDD.analyze()
pointRDD.spatialPartitioning(GridType.QUADTREE)
polygonRDD.spatialPartitioning(pointRDD.getPartitioner)
pointRDD.buildIndex(IndexType.QUADTREE, true)
var joinResultPairRDD = JoinQuery.SpatialJoinQueryFlat(pointRDD, polygonRDD, true, true)
val list1 = polygonDf.columns.toList
val list2 = pointDf.columns.toList
var joinResultDf = Adapter.toDf(joinResultPairRDD, list1, list2, sparkSession)
joinResultDf
------------------------------------
Jia Yu,
Ph.D. Student in Computer Science
Reach me via Jia Yu's Homepage | GitHub Repositories
--
You received this message because you are subscribed to the Google Groups "GeoSpark Discussion Board" group.
To unsubscribe from this group and stop receiving emails from it, send an email to geospark-discussio...@googlegroups.com.
To post to this group, send email to geospark-dis...@googlegroups.com.
Visit this group at https://groups.google.com/group/geospark-discussion-board.
To view this discussion on the web visit https://groups.google.com/d/msgid/geospark-discussion-board/0d8e4357-cb27-45dd-b429-08a86cddf4bb%40googlegroups.com.