On 26 October 2012 04:37, Philippe Apparicio <[email protected]> wrote:

> Hi all,
> I have begun recently to use GeoTools. I want to draw several deviational
> ellipses and calculate next their intersection and union. I found the
> methods for calculating the union and intersection within the Geometry
> Class. However, I have some trouble to draw the ellipses.
> I wrote a code to obtain five double values for creating the ellipse:
>
> 1) the X center point of the ellipse;
>
> 2) the Y center point of the ellipse;
>
> 3) the semi major axis length of the ellipse;
>
> 4) the semi minor axis length of the ellipse;
>
> 5) the rotation of the ellipse expressed in degree and measured from North
> (azimuth).
>
>
> Which method is it possible to use for creating an ellipse by using these
> five parameters?
>
> I found an amazing class (GeometryBuilder Class org.geotools.geometry.jts;
> http://docs.geotools.org/stable/javadocs/org/geotools/geometry/jts/GeometryBuilder.html),
> but I don't understand some parameters of the Ellipse method:
>
> *ellipse*(double x1, double y1,double x2, double y2, int nsides)
>
> Creates an elliptical Polygon from a bounding box with a given number of
> sides.
>
>
>
> What does mean the *nsides *parameter? It is not the rotation because it
> is expressed as Integer. Anybody knows how to calculate the coordinates of
> the bounding box, and the nsides with the five parameters mentioned above.
>
>
>
GeoTools can't handle actual curves so it fakes them using many straight
edges. The nsides parameter determines how many of those edges to use,
there is a trade off here as more sides looks better while less sides will
draw quicker.

The bounding box will be center +/- semi-major axis in one direction and
center +/- semi-minor axis in the other.

Ian
------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_sfd2d_oct
_______________________________________________
GeoTools-GT2-Users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users

Reply via email to