Calculate intersection of large circles

26 views
Skip to first unread message

Francesco Disperati

unread,
Aug 24, 2014, 8:31:42 AM8/24/14
to rgeo-...@googlegroups.com
Hello everyone!

I have a set of points around the globe, and for each point I draw a circle with a very large radius (hundreds or thousands of km) that represents the influence area. I need to calculate the intersection (if any) of these circles, and the centroid of the resulting area.

I started using a RGeo::Geographic.simple_mercator_factory and plotting the result with Google Maps (see area.png attachment).
The problem is these circles are drawed with a projected coords system, so on a very large scale they're totally inaccurate. For comparison, see circle.png attachment: the blue area is the one calculated by RGeo, the light-blue one is the real circle calculated by Google Maps.

Using RGeo::Geographic.spherical_factory I get the right circle shapes, but I cannot perform calculations like intersection or area centroid.

Is there a way to implement these geometry operations on a RGeo spherical factory? If not, what other tools could be used?

Thank you!
circles.png
area.png
Reply all
Reply to author
Forward
0 new messages