openjump-drillgis-pluigin is an experimental extension for OpenJump GIS that allows execution of spatial queries against Apache Drill with DrillGis contrib module.
Clone/download the sourcecode and build with maven
$ mvn clean package
You should have target/DrillGISPlugin-1.3.0.jar now.
Download OpenJump portable snapshot build:
then copy target/DrillGISPlugin-1.3.0.jar to OpenJump ext directory. Also ensure to copy drill-jdbc-all-1.2.0.jar in the same place.
Start Apache Zookeeper:
zookeeper/bin/zkServer.sh start
Start Apache Drill (with gis contrib module available as drill-gis plugin or included in Apache Drill master branch):
apache-drill-1.3.0/bin/drillbit.sh start
Start OpenJump
OpenJump/bin/oj_linux.sh
Select 'File' -> 'Run Datastore Query'
Click 'Connection Manager' icon and click 'Add'
Choose DrillGis as driver and specify drill server name i.e. localhost
After connecting to drill you are ready to specify sample query:
select columns[2] as city, ST_Point(columns[4], columns[3])
from cp.`sample-data/CA-cities.csv`
where
ST_Within(
ST_Point(columns[4], columns[3]),
ST_GeomFromText(
'POLYGON((-121.95 37.28, -121.94 37.35, -121.84 37.35, -121.84 37.28, -121.95 37.28))'
)
)
which shows points from our dataset limited to region near San Jose as shown here:
Karol Potocki
GPL 2.0 License