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.

  • Edit the title to "in Hadoop" rather than "in ArcMap"? – Randall Whitman Apr 26 '16 at 15:37

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]

  • 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 '16 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. – Randall Whitman Apr 29 '16 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 '16 at 16:05

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


  • 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] – Randall Whitman Apr 26 '16 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 '16 at 20:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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