Hi all,

I need to perform a lot of "point in polygon" checks and want to use Hive
(currently I mix Hive, Sqoop and PostGIS in an Oozie workto do this).

In an ideal world, I would like to create a Hive table from a Shapefile
containing polygons, and then do the likes of the following:

  SELECT p.id, pp.id FROM points p, polygons pp WHERE pp.contains(geom,
toPoint(p.lat,p.lng))

Has anyone done anything along these lines?

Alternatively I am capable of doing a UDF that would read the shape file
into memory and basically do a map side join using something like a slab
decomposition technique.  It is more limited but would meet my needs
allowing e.g.:

  SELECT contains(p.lat,p.lng, '/data/shapefiles/countries.shp') FROM
points;

Before I start I thought I'd ask folks as I suspect people are doing this
kind of thing on Hive by now (thinking FB and user profiling by political
boundaries etc)

I'd love to hear from anyone who's investigated this or could provide any
advice.

Thanks!
Tim

Reply via email to