2

Does anyone know the equivalent of the spatial join tool in ArcMap that can be used in Hadoop?

I am trying to join point and polygon data in Hadoop and create a new point files that adds the attributes of the polygon data.

1
  • Edit the title to "in Hadoop" rather than "in ArcMap"? Apr 26, 2016 at 15:37

2 Answers 2

3

I think this would be spatial aggregation based on this article.

https://blogs.esri.com/esri/arcgis/2015/03/25/new-spatial-aggregation-tutorial-for-gis-tools-for-hadoop/

2
  • That article on spatial binning, plus the GIS Tools for Hadoop samples of Point-in-Polygon join, should provide the info needed to develop a spatial join. [collaborator] Apr 26, 2016 at 18:28
  • Geoffrey this would give me the count of points in a polygon. What i was looking for was returning the polygon each point is located within.
    – mkeller
    Apr 27, 2016 at 20:30
0

Adapt the GIS Tools for Hadoop samples of Point-in-Polygon join, to output the desired info, rather than output counts.

Something to the effect of the following untested query:

SELECT earthquakes.*, counties.* from earthquakes, counties WHERE ST_Contains(counties.boundaryshape, ST_Point(earthquakes.longitude, earthquakes.latitude));

[disclosure: collaborator]

3
  • I was able to use: SELECT eventid FROM earthquakes JOIN counties WHERE counties.name = 'San Bernardino' AND ST_Contains(counties.boundaryshape, ST_Point(earthquakes.longitude, earthquakes.latitude)); This gives me the earthquakes located within an individual county but i wanted to get a list of earthquakes for each county.
    – mkeller
    Apr 29, 2016 at 13:38
  • Might be possible with Hive ARRAY - you could try looking up samples or reference documentation, and/or ask a separate question, about using ARRAY in HQL/SQL. Apr 29, 2016 at 15:09
  • 1
    SELECT counties.name, earthquakes.eventid FROM counties JOIN earthquakes WHERE ST_Contains(counties.boundaryshape, ST_Point(earthquakes.longitude, earthquakes.latitude)) GROUP BY name, eventid This code let me list the polygon each point was in.
    – mkeller
    Apr 29, 2016 at 16:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.