0

I would like to use the GEO2D function in Sphinx (SphinxQL) but I would like to use it without searching an index.

I have the polygon and the latitude and longitude already and just want to calculate if the point is inside the polygon. So this is what I want:

SELECT CONTAINS(GEOPOLY2D($polygon),$lat_deg, $long_deg)

in MySQL you could run a query without specifying a database:

SELECT 1+1

How could I do this in Sphinx? I already tried to run it with an index (FROM index LIMIT 1) but that seems to do a full table scan and thus take a long time.

I could make a new index with just one record but maybe there is another way?

Nin
  • 2,960
  • 21
  • 30
  • WHY do you want to do this in sphinx anyway? Sounds like using the wrong tool. – barryhunter Jul 15 '13 at 20:48
  • The main reason is that I use it in a regular way also. So searching for records with a lat/lng inside the polygon. But in some cases the lat/lng is from a different source so it would be easy to use the same routine and just skip the FROM index part. And I can easily switch from GEO2D To POLYGEO2D if needed and I don't have to make/finetune it in another language with maybe (slightly different results. – Nin Jul 16 '13 at 06:14

0 Answers0