Hi Zac
Thanks for your reply If you have any suggestions on the best way to record geo fence zones with z radius so that the system can then detect whenever a given reported location is inside / outside of a given zone I would appreciate it I am using the Bing mapping api and I am developing the tracking portal app in CF Kind Regards Claude Raiola SAMARIS Software Call 1300 255 990 From: cfaussie@googlegroups.com [mailto:cfaussie@googlegroups.com] On Behalf Of Zac Spitzer Sent: Wednesday, 5 June 2013 3:07 PM To: CFAussie Subject: Re: [cfaussie] Cold Fusion with SQL and Geo Spatial Mapping Geo Fence Functionality SQL Server 2008 also supports proper spatial? On Wed, Jun 5, 2013 at 2:19 PM, Robin Hilliard <ro...@rocketboots.com.au> wrote: Hi Claude, Funny, happened to have some CF code to check for polygon containment open when I saw your post: function polyContains(poly, lon, lat) { var j = 1; var oddNodes = false; var lenPoly = arrayLen(poly); for (var i = 1; i < lenPoly; i += 2) { j = i + 2; if (j > lenPoly - 2) j = 1; if (((poly[i + 1] > lat) != (poly[j + 1] > lat)) // the polygon edge passes through the lattitude lat and ((((lat - poly[i + 1]) * (poly[j] - poly[i])) / (poly[j + 1] - poly[i + 1])) < lon)) // at lattitude lat, polygon edge is west of lon oddNodes = !oddNodes; } return oddNodes; }; I'm using this because MySQL spatial polygon containment only compares bounding boxes (on the version supported by Redhat). MySQL whittles the list down to a few polygons and I use this to do the rest, based on the odd/even polygon containment test. Note that poly is a flat array containing lon lat pairs. I'm currently running some tests on a database of about 5,000 polygons covering SE Australia, sampling every one km grid. There are a few anomalies I'm investigating, hopefully it's the data and not an algorithm glitch but you have been warned. Robin ROBIN HILLIARD Chief Technology Officer ro...@rocketboots.com.au RocketBoots Pty Ltd Level 11 189 Kent Street Sydney NSW 2001 Australia Phone +61 2 9323 2507 Facsimile +61 2 9323 2501 Mobile +61 418 414 341 www.rocketboots.com.au <http://www.rocketboots.com.au/> On 04/06/2013, at 7:58 PM, rai...@ozemail.com.au wrote: I have the Tracking Server with listener set up so the listener captures the data (long / lat) sent from the mobile tracking devices to the server, which is then stored into an sql table I have the Bing Maps API set up so the locations stored in the above database table correctly display on the bing map The challenge is trying to figure out how to create Geo Fence functionality combining SQL 2008, using Bing Maps API and using CF application to manage and display the Geo Fences I am wanting to be able to create circular zones so the co ordinates are saved in the geo fence table assigned to a specific device id, Once the geo fences are created and stored in the geo fence table each new location sent to the tracking server then needs to be validated against existing geo fences to determine if the new location is inside or outside of geo fences listed in the geo fence table If anyone can assist to direct me to a resource or example code that deal with the above I would appreciate the advise Kind Regards Claude Raiola -- You received this message because you are subscribed to the Google Groups "cfaussie" group. To unsubscribe from this group and stop receiving emails from it, send an email to <mailto:cfaussie+unsubscr...@googlegroups.com> cfaussie+unsubscr...@googlegroups.com. To post to this group, send email to <mailto:cfaussie@googlegroups.com> cfaussie@googlegroups.com. Visit this group at <http://groups.google.com/group/cfaussie?hl=en> http://groups.google.com/group/cfaussie?hl=en. For more options, visit <https://groups.google.com/groups/opt_out> https://groups.google.com/groups/opt_out. -- You received this message because you are subscribed to the Google Groups "cfaussie" group. To unsubscribe from this group and stop receiving emails from it, send an email to cfaussie+unsubscr...@googlegroups.com <mailto:cfaussie%2bunsubscr...@googlegroups.com> . To post to this group, send email to cfaussie@googlegroups.com. Visit this group at http://groups.google.com/group/cfaussie?hl=en. For more options, visit https://groups.google.com/groups/opt_out. -- Zac Spitzer Solution Architect / Director Ennoble Consultancy Australia +61 405 847 168 -- You received this message because you are subscribed to the Google Groups "cfaussie" group. To unsubscribe from this group and stop receiving emails from it, send an email to cfaussie+unsubscr...@googlegroups.com. To post to this group, send email to cfaussie@googlegroups.com. Visit this group at http://groups.google.com/group/cfaussie?hl=en. For more options, visit https://groups.google.com/groups/opt_out. -- You received this message because you are subscribed to the Google Groups "cfaussie" group. To unsubscribe from this group and stop receiving emails from it, send an email to cfaussie+unsubscr...@googlegroups.com. To post to this group, send email to cfaussie@googlegroups.com. Visit this group at http://groups.google.com/group/cfaussie?hl=en. For more options, visit https://groups.google.com/groups/opt_out.