You could reencode the lines into a MySQL spatial column http://dev.mysql.com/doc/refman/5.0/en/spatial-extensions.html then can directly query that. (for the most part tho, mysql just does MBR checks with spatial indexing)
... the whole basis is you need to build some sort of 'spatial index'. Could use the mysql functions, or your own homegrown system - like noted in last reply. Most spatial indexes involve duplicating the data into some easily queryable format. Because these probably just work on bounding rectangles -rather than the detailed polygone, maybe you will still need to do a proper point-in-polygone check, to be sure. On Mon, Jan 23, 2012 at 5:22 PM, Big G <[email protected]> wrote: > I'm using MySQL and the polygons are encoded using > google.maps.geometry.encoding.encodePath > > I'm just wondering if there is a better way of finding which polygons > contain the point rather than using foreach loop on all the polygons as > eventually there could be up to 20,000 polygons in the DB. > > any ideas/help would be much appreciated > > -- > You received this message because you are subscribed to the Google Groups > "Google Maps JavaScript API v3" group. > To view this discussion on the web visit > https://groups.google.com/d/msg/google-maps-js-api-v3/-/_rRXJwFwbJsJ. > > To post to this group, send email to [email protected]. > To unsubscribe from this group, send email to > [email protected]. > For more options, visit this group at > http://groups.google.com/group/google-maps-js-api-v3?hl=en. -- You received this message because you are subscribed to the Google Groups "Google Maps JavaScript API v3" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/google-maps-js-api-v3?hl=en.
