I've seen this question: See if lat / long falls within a polygon using mysql
Which states that the mysql GIS extensions aren't fully implemented yet. Can someone clear this up for me - does this mean if I have a polygon stored and want to detect if a point falls within a certain polygon, it won't be 100% accurate? If so, how accurate will it be?
Also, the SQL required for this, off the top of my head, would it be something along the lines of:
SELECT * WHERE WITHIN(POINT(_LAT_ _LONG_), `polygon`)
(Where polygon is a table column and the point is constructed from given lat and long values.)
If the accuracy is sufficient, how would you find points close to a given Lat and Long? There's differing opinions regarding using COS/SQRT or built in DISTANCE functions, which is best and/or what's the best method of doing?
Essentially:
- Are the mySQL GIS extensions up to the job for detecting if a point is within a polygon (has to be fairly accurate, polygon is not a defined shape or size).
- If they are, what is the best method for detecting this, and additionally want is the best method for finding points near a given Lat and Long