I agree it makes sense from a real-world perspective.
But it's also nice to be tolerant of "messy" geometric cases. That way,
JTS can be used with a wider variety of geometric models, and requires
less data cleaning. I suspect the OGC-SFS was trying to be somewhat
tolerant of different geometric models. That would explain allowing
arbitrary orientation for rings, allowing LineStrings to cross, allowing
repeated points, etc. Every geometry model out there seems to have
slightly different rules and constraints - it's nice to try and
eliminate as many constraints as is reasonably possible.
It would be a bit fussy to handle single-point linestrings, but
certainly not impossible, and it should be possible to define a
reasonable semantics for handling them. Although... the OGC uses the
"Mod-2 Boundary Rule", which says that linestring endpoints are on the
boundary if their multiplicity is odd. So is the point of a
2-identical-point linestring on the boundary or in the interior?
Sunburned Surveyor wrote:
Martin,
What you did to me seems very logical. Isn't the statement "Under this
rule, 2-same-point linestrings would collapse to a single point, which
is not a valid linestring." a true statement?
>From a surveyors perspective any line that is shorter than 0.10 of a
foot isn't a line anyways, it is your measurement error. :]
The Sunburned Surveyor
On 8/15/07, Martin Davis <[EMAIL PROTECTED]> wrote:
This is because according to JTS, LineStrings with exactly two identical
points are invalid. Thus the result from any geometry operation is
undefined and not reliable.
Now, at one time I thought I had a good reason for implementing this
rule, based on the OGC Simple Features spec. But reviewing the spec
now, I can't find anything obvious which would require this rule. I
think I might have been basing this constraint on the rule that
"repeated points in geometries are treated as if they are a single
point". Under this rule, 2-same-point linestrings would collapse to a
single point, which is not a valid linestring. But I'm not so sure this
is a useful treatment. Anyone have any thoughts on this? Or examples
of other geometry systems which specify a rule for this?
Erik Løvlie wrote:
Hello everyone, I have an unexpected result when comparing two
degenerate LineStrings:
Geometry geom1 = geomFactory.createLineString(new Coordinate[]{new
Coordinate(1, 2), new Coordinate(1, 2)});
Geometry geom2 = geomFactory.createLineString(new Coordinate[]{new
Coordinate(1, 2), new Coordinate(1, 2)});
boolean equal = geom1.equals(geom2);
boolean equalsExact = geom1.equalsExact(geom2);
In the above code, equal is false and equalsExact is true. Is this the
correct behavior, and if it is, is it documented anywhere?
Regards,
Erik Loevlie
_______________________________________________
jts-devel mailing list
jts-devel@lists.jump-project.org
http://lists.refractions.net/mailman/listinfo/jts-devel
--
Martin Davis
Senior Technical Architect
Refractions Research, Inc.
(250) 383-3022
_______________________________________________
jts-devel mailing list
jts-devel@lists.jump-project.org
http://lists.refractions.net/mailman/listinfo/jts-devel
_______________________________________________
jts-devel mailing list
jts-devel@lists.jump-project.org
http://lists.refractions.net/mailman/listinfo/jts-devel
--
Martin Davis
Senior Technical Architect
Refractions Research, Inc.
(250) 383-3022
_______________________________________________
jts-devel mailing list
jts-devel@lists.jump-project.org
http://lists.refractions.net/mailman/listinfo/jts-devel