I tried that, and it solved the exception but the result wasn't right because a line between the endpoint of the last inner polygon and the endpoint of the exterior polygon was created. So now I read the coordinates and take the first ring of coordinates as the shell and the remaining rings of coordinates like holes and create the new polygon with:
factory.createPolygon(shell, holes); and this works, but I'm not sure that it's the more efficient way. What do you think? Cheers! Gloria 2008/5/5 Sunburned Surveyor <[EMAIL PROTECTED]>: > Gloria, > > I think your polygon ring definitions need to repeat the starting > coordinate as the closing coordinate? Could this be the problem? It > seems like if based on the type of exception being thrown. > > The Sunburned Surveyor > > On Mon, May 5, 2008 at 10:35 AM, Gloria Muñoz > <[EMAIL PROTECTED]> wrote: > > Hi all, > > > > I need to create a Polygon which has inner polygons. I've noticed that > this > > kind of polygons coordinates are written like: > > polygonCoordinates = p0_0, p0_1..., p0_n, p1_0, p1_1..., p1_m, ...,pN_0, > > pN_1..., pN_s > > where N is the number of polygons including the exterior one, and n,m, s > the > > respective sizes. > > But when I try to do: > > LinearRing linearRing = factory.createLinearRing(polygoncoordinates); > > > > I obtain this error: > > java.lang.IllegalArgumentException: points must form a closed linestring > > > > so, how can I create that kind of polygons?shouldI take the inner > polygons > > like holes?? > > > > Thanks! > > > > _______________________________________________ > > jts-devel mailing list > > [email protected] > > http://lists.refractions.net/mailman/listinfo/jts-devel > > > > > _______________________________________________ > jts-devel mailing list > [email protected] > http://lists.refractions.net/mailman/listinfo/jts-devel >
_______________________________________________ jts-devel mailing list [email protected] http://lists.refractions.net/mailman/listinfo/jts-devel
