I am trying to figure out the state that Berlin is in. So now my query SELECT * FROM states WHERE ST_Contains(Geo, Point(13.383068, 52.530644));
return two results. One for Berlin which is correct, but also Brandenburg which is surrounding Berlin. See the attached graphics.
So it seems that ST_Contains
does not account for the hole inside.
Currently the geospatial column is of datatype MulitPolygon.
Is there any other my-sql function that I can use to only find the correct state?
ST_IsValid()
If the internal ring doesn't have clockwise rotation (opposite of the external counter-clockwise rotation), then it's an invalid overlapping exterior ring, which would generate strange topology errors. – Vince Jan 10 '19 at 14:13