views:

14

answers:

0

Hi -

I'm using the Circle overlay as part of the V3 of the Google Maps Javascript API (i.e., see below - we have a subsequent call that actually sets radius/etc.) to display goe-spatial locations in our application.

   var circle = new google.maps.Circle({
      fillColor: lCircleColor,
      strokeWeight: 2
    });

We also have a background server process that is calculating distances of points from the center of the circle to determine whether points fall inside or outside the circle - when points fall inside we raise an alarm. There is one particular case we had recently where a point (lat=31.197163, lon=-83.87292) falls right on the border of the circle (lat=31.1998, lon=-83.8738, radius=1000ft).

When using the Haversine formula for calculating distance the calculated distance is greater than the radius whereas Vincenty (more accurate) the distance is less than the radius thus causing an alarm to be generated by the back-end process that the point falls within the location.

My question is related to how Google Maps displays the Circle overlay. When we view it in our application it appears to fall just outside the circle (only visible when zoomed in to the greatest extent). I had read elsewhere that for calculating distance that Google's APIs use the Vincenty algorithm but for displaying their overlay do they assume a spherical shape (and thus maybe explaining why the point appears to fall outside of the circle)?