Hey Richard,

I suspect the answer is that even if you could generate this envelope,
you would not want to --- none of the mathematical infrastructure of the
library would deal correctly with your envelope once you generated it so
you would merely delay your problems one small step. Yes geotools is
still a toy.

However, the good news is that we are gearing up to work on this by
tackling the generalization of the JTS geometry engine to different
mathematical spaces notably the 2D geometrical space of the closed
surface of an ellipsoid . First step is a good design then we can tackle
the actual writing as time or desire allows.

For now, you will have to work around the issue. As Jody says, for now
people working over the poles are working in polar sterographic
coordinates.

good luck,
--adrian


On Tue, 2008-01-22 at 16:19 -0800, Jody Garnett wrote:
> Hi Richard; I had this thread flagged in case any interesting replies 
> came up; did you manage to make any progress? The two boundary cases 
> (the poles and the dateline) are something of a trouble and I have yet 
> to hear of a good answer. One bad answer that was recommended to me once 
> was to switch to polar coordinates; and handle them as such (one of the 
> 3D globe project had some success with this approach, but I would not be 
> sure where to start).
> 
> Jody
> 
> Richard Stanfield wrote:
> > Since Geotools relies so heavily on JTS, is there any way to make it
> > accurately calculate the correct maximum Y value for a Geomety that
> > encompasses but does not contain the north pole? If not, how can I override
> > the envelope calculations?
> >
> > For example, if I create a Polygon that contains the North Pole, my maximum
> > Latitude is 90. Below is a code snippet, that does just that. The max and
> > min values are both 85.
> >
> > It seems that no matter what SRS I use, I will always run into this problem.
> > My largest (northernmost) point is not contained in any of the coordinates
> > that make up the polygon. Is there anyway around this limitation? 
> >
> > GeometryFactory gf = new GeometryFactory(new
> > PrecisionModel(PrecisionModel.FLOATING), 4326);
> > Coordinate[] containsNP = new Coordinate[5];
> >     containsNP[0] = new Coordinate(-60, 85);
> >     containsNP[1] = new Coordinate(160, 85);
> >     containsNP[2] = new Coordinate(120, 85);
> >     containsNP[3] = new Coordinate(-20, 85);
> >     containsNP[4] = new Coordinate(-60, 85);
> >     LinearRing exteriorNP = gf.createLinearRing(containsNP);
> >     Polygon NPPolygon = gf.createPolygon(exteriorNP, holes);
> >     Envelope env = NPPolygon.getEnvelopeInternal();
> >     System.out.println("Here is the envelope of the polygon that crosses
> > 180");
> >     System.out.println("Min Y: " + env.getMinY());
> >     System.out.println("Max Y: " + env.getMaxY());
> >   
> 
> 
> -------------------------------------------------------------------------
> This SF.net email is sponsored by: Microsoft
> Defy all challenges. Microsoft(R) Visual Studio 2008.
> http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
> _______________________________________________
> Geotools-gt2-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users


-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Geotools-gt2-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users

Reply via email to