Search code examples
javascriptphpjquerygeolocationgeocoding

Geo Fencing accuracy


I have been wanting to automate jobs sent out to owners of areas within my business automatically and remove the need to find out who owns the closest area to the customer wanting work done.

My problem is a area owned by a tradesman is not set by postcodes, suburb names, city names etc. It is a customised area drawn out on a map.

I have not come accross a solution as of yet, however im hoping GEO Fencing can help me. Currently i can find only pre-made patterns like circles, polygons etc. They are not accurate enough due to the nature of the areas. Some areas are literally on the border of each other and again they are not circles or polygon shapes. They are literally drawn out randomly just like a country border would be.

I know i can use a drawing tool on google maps for example to re-draw them. However i dont think you can then store those drawn out areas in a long and lat as it just wouldnt work.

Does anyone have any solution for me?


Solution

  • I found a solution after all. By creating a KML file i can draw out and re-create the areas i need. Once i have done that i can export the KML file.

    You can then convert the KML file to Google maps API and generate google maps polygons based on that data.

    You can then query a long and lat and see what polygon it falls into.

    Once i finish it up I will try to remember to leave a snippet for an example.