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