Take a look at this excellent write-up by Dan Meany on implementing spatial data queries on Apache Phoenix using UDFs and secondary indexinghttps://github.com/threedliteguy/General/wiki/Adding-spatial-data-queries-to-Phoenix-on-HBase