1

Using MySQL 5.6, I have converted lat and lng fields into Points - using AsText, I can see this is OK.

I have another table to hold the polygon data, and again using AsText, I can see the correct points are in database.

My Query is this

SELECT P.PointId, P.Title, PLY.Name FROM polys as PLY, 
points AS P
WHERE ST_CONTAINS(PLY.Polygon, P.gPoint)

There are points in the database within this polygon, no error, but none are coming through when I run this query.

Is this query correct, or do I need to use extra MySQL Extensions?

  • 1
    I would double check the geometries first and make sure that they have proper coordinates and same projection. Consider to add couple of your geometries as WKT into your question. – user30184 Jul 17 '18 at 18:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.