[jts-devel] A comment to JTS Technical Specification

Mateusz Łoskot mateusz at loskot.net
Mon Apr 17 13:41:07 PDT 2006


Hi,

Recently, I was reading JTS Technical Specification and I encountered
some interesting note about inconsistency in Well-Known-Text format
definition.

The specification says:

"Note that there is an inconsistency in the SFS. The WKT grammar states
that MultiPoints are represented by "MULTIPOINT ( ( x y), (x y) )",
but the examples show MultiPoints as "MULTIPOINT ( x y, x y )".
Other implementations follow the latter syntax,
so JTS will adopt it as well."

I tried to find some update regarding this issue and there is a note on
OpenGIS forum. Here is how OGC experts explain it:

(Source:
http://feature.opengeospatial.org/forumbb/viewtopic.php?t=301)

/////////////////////////////////////////////////////////////////////////
// Date: Feb 27, 2006

"He is right on the error, but wrong on the correction. According to ISO
rules, the constructions (normative text) take precedence over examples
(informative text) and therefore the example is wrong, and should be:

MULTIPOINT((10 10), (20 20))

This is more consistent with the other GeomCollection such as:

MULTILINESTRING ((10 10, 20 20), (15 15, 30 15))

And (the extra "()" is needed to group rings into polygons):

MULTIPOLYGON (((10 10, 10 20, 20 20, 20 15, 10 10)),((60 60, 70
70, 80 60, 60 60 )))

There probably is a good argument for using the GeomCollection pattern
and requiring tagged text at each point

GEOMETRYCOLLECTION(POINT (10 10), POINT (30 30), LINESTRING (15
15, 20 20))

Which would make it:

MULTIPOINT(POINT(10 10), POINT(20 20))

but that would have to be change requested since it modifies
normative text.

// EOF
/////////////////////////////////////////////////////////////////////////

So, as you can read in the note above, examples should be considered
as "wrong".

I'd like to ask how JTS handles this issue in details.
How should I understand this statement?

"Other implementations follow the latter syntax, so JTS will adopt it as
well."

What does this adoption mean?

Thanks for your help in advance

Cheers
-- 
Mateusz Łoskot
http://mateusz.loskot.net



More information about the jts-devel mailing list