RE: [OpenMap Users] Creating a shape from intersecting circles?

From: Butler, Jason <>
Date: Thu, 3 Aug 2006 10:07:14 +1000


Your first idea can be used to do what you want. I think the steps are
1. Create the circles as OMCircles.
2. Project them onto the map. i.e. myOMCircle.generate(myProjection);
This generates the shape in screen coordinates so the shapes of the circles will change, based upon the projection used.
3. Extract the Areas from them. java.awt.geom.Area myArea = new Area(myOMCircle.getShape());
4. Use Area to create the intersection. MyArea.intersect(myOtherArea)
5. Paint the final area into the screen in the paint section of your Layer. ((Graphics2D)g).draw(myArea);

Hope this helps,


-----Original Message-----
From: [] On Behalf Of Oystein E. Thorvaldsen
Sent: Wednesday, 2 August 2006 7:32 AM
Subject: [OpenMap Users] Creating a shape from intersecting circles?


I'm trying to calculate and display a geographic region defined by the intersection of a number of overlapping circles. (See, the red area) I know the coordinates of the center of all the circles, and their radi. How do I best go about doing this in OpenMap?

I've perused the list archives, and API and have some possible starting points. I would appreciate feedback on the feasibility of these, and which one is best suited. Of course I'm open to entirely different ways of doing this.

1) Create the circles as OMCircles. Using getShape to extract the Shape of every OMCircle and create Areas using Area(Shape). Intersecting the created Areas to obtain my desired region in the form of an Area. Using getPathIterator(),possibly with flattening, to create a GeneralPath and create an OMPoly (or OMGraphicsList?) from it. I know this would be costly performance wise, but that is not an issue for me.

One post ( ) mentioned the need for Projection.forward() in a similar situation. In
.forward() is not mentioned. And this situation also is similar to my problem. Is the usage of Graphics2D straightforward, or do I have to use forward(), and take screen resolution etc into account?

2) The .geo-package seems to deal with this type of functionality, but I'm unable to find the specific functions I need. Additionally the classes in the package are somewhat less well documented than the rest of OpenMap.

3) Try to do the intersection algebraically and store the resulting region in some kind of data structure containing the vertices and arcs between them. Then create an OMPoly or OMGraphicsList based on the data structure. This would still involve calculating the geographical coordinates of the vertices somehow. (If anyone could point me to an elegant way of doing the intersection algebraically I would appreciate it.)

Řystein E. Thorvaldsen

[To unsubscribe to this list send an email to ""
with the following text in the BODY of the message "unsubscribe openmap-users"]
[To unsubscribe to this list send an email to ""
with the following text in the BODY of the message "unsubscribe openmap-users"]
Received on Wed Aug 02 2006 - 20:47:57 EDT

This archive was generated by hypermail 2.3.0 : Tue Mar 28 2017 - 23:25:07 EDT