Hey there,

Here are a few approaches you could use, depending on what seems easiest to
you and how much you want to learn about handling spatial data:

   - MySQL has a spatial extension that creates a new type of column that
   will let you store polygons and points, and will let you directly query
   MySQL for points that are within a polygon.  This is a good approach, and
   what I'd recommend given your description.
   http://dev.mysql.com/doc/refman/5.0/en/spatial-extensions.html
   - postgres (another database system) has a more powerful spatial
   extension called PostGIS.
   - Here's a link to someone's PHP code that can do point in polygon tests:
   http://eriestuff.blogspot.com/2008/02/google-maps-point-in-polygon.html
   - There is a PHP extension for the OGR/GDAL libraries that will let you
   create polygons and points and do tests in code:
   http://dl1.maptools.org/dl/php_ogr/php_ogr_documentation.html

--j

On Thu, May 13, 2010 at 11:08 AM, laxmidi1994 <[email protected]>
wrote:
> Hi Ian,
>

> Thanks for the advice. I appreciate it.
>
> My problem is that the code I've got is really difficult to maintain.
> This is my (admittedly) ridiculous workflow:
>
> 1) I've got actionscript code that checks which points are in which
> polygons. I can only run a month's worth of data at a time as the
> browser will time out.
>
> 2) Then I take those results and stick them in a mysql table.
>
> 3) I repeat that process until the table is up to date.
>
> 4) Then I comment out the actionscript code that checked the point in
> polygon and uncomment the code that I use to display the data.
>
> 5) Compile and upload to the server.
>
>
> So, I'm trying to figure out a more efficient way of working. The
> above works, but takes a lot of maintenance time and it's easy to make
> a mistake when updating the mysql tables.
>
>
> Thanks.
>
>
>
>
> On May 13, 10:42 am, Ian Appleby <[email protected]>
> wrote:
>> If your points/polygons don't change, you'd probably be better off
>> building a static lookup.  It's always going to be faster than
>> searching.
>>
>> Php can probably do it faster than flash, but the network aspect would
>> undo part of that, it depends what sort of run times you're getting as
>> to whether it's significant.
>>
>> --
>> You received this message because you are subscribed to the Google Groups
"Google Maps API For Flash" group.
>> To post to this group, send email to
[email protected].
>> To unsubscribe from this group, send email to
[email protected]<google-maps-api-for-flash%[email protected]>
.
>> For more options, visit this group athttp://
groups.google.com/group/google-maps-api-for-flash?hl=en.
>
> --
> You received this message because you are subscribed to the Google Groups
"Google Maps API For Flash" group.
> To post to this group, send email to
[email protected].
> To unsubscribe from this group, send email to
[email protected]<google-maps-api-for-flash%[email protected]>
.
> For more options, visit this group at
http://groups.google.com/group/google-maps-api-for-flash?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Google Maps API For Flash" 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-api-for-flash?hl=en.

Reply via email to