Has anyone else encountered problems with MBRWithin? I understand the concept that the function draws a box around the polygon, but I'm still experiencing some strange results.
Specifically, I converted Zillow's neighborhood data into MySql format and then imported the data into my database. However, when querying the data in some instances it's retuning neighborhoods that aren't very related. Additionally I've checked the Zillow data in my table to verify it's accuracy.
Here's an example, when I run a query to get the neighborhood for the following point (-73.958417 40.772724) in New York I should get "Upper East Side" as the neighborhood. However, the query returns "Central Park, Upper East Side, Upper West Side" - I could maybe see how Central Park would be listed as it's nearby and I guess it could be overlapping in some spots, but that's not the case of the Upper West Side. Here is the MultiPolygon data for the Upper West Side:
Anyway, my basic query is:
SELECT neighborhood_name FROM neighborhood_table WHERE MBRWithin(PointFromText('POINT(-73.958417 40.772724 )'),ogc_geom);
Where ogc_geom represents the MultiPolygon data blob.
Interestingly I also tried implementing the MBRWithin Alternative posted by Gert Serneels http://forums.mysql.com/read.php?23,286574,286574
and interestingly it eliminated the "Central Park" result, but not the more obvious "Upper West Side"
If anyone has dealt with this problem and solved it I would appreciate a response as I'm pulling my hair out!