This peculiarity is due to adhering to the OGC Simple Features for SQL
specification (ver 1.1 - sec 2.1.10.1). For some reason it specifies
that the return type of getInteriorRingN is LineString. At the time JTS
was originally designed we attempted to follow this spec as closely as
possible. In hindsight it might have been better to work towards the
spirit rather than the letter of the spec.
A reason to *not* provide a method getInteriorRings() -> LinearRing[] is
that this exposes the internal implementation of the collection of holes.
Farrukh Najmi wrote:
I am new to JTS API so please forgive any misunderstanding on my part
regarding the API...
The Polygon.getInteriorRingN method seems unusual in that it does not
return a LinearRing but instead returns a LineString. Presumably that
LineString is slways a LinearRing? Are there any exceptions? If not,
then why not have the API method return a LinearRing. Also, would it
make sense to consider a method that returns an Array of LinearRing as
follows:
public LinearRing[] getInteriorRing();
Thanks for any clarification.
--
Martin Davis
Senior Technical Architect
Refractions Research, Inc.
(250) 383-3022
_______________________________________________
jts-devel mailing list
[email protected]
http://lists.refractions.net/mailman/listinfo/jts-devel