[jts-devel] A comment to JTS Technical Specification
Martin Davis
mbdavis at VividSolutions.com
Wed Apr 19 09:02:44 PDT 2006
Darn - I guess we guessed wrong. (Actually, it makes sense that spec takes precedence over the examples, but my main motivator for the choice was looking at what other implementations did - and they got it wrong too, apparently).
I guess the best solution is to enhance the reader to accept either form, and modify the writer to output the correct syntax.
> What does this adoption mean?
It means JTS currently uses the format with fewer brackets.
Martin Davis, Senior Technical Architect
Vivid Solutions Inc. www.vividsolutions.com
Suite #1A-2328 Government Street Victoria, B.C. V8T 5G5
Phone: (250) 385 6040 - Local 308 Fax: (250) 385 6046
> -----Original Message-----
> From: jts-devel-bounces at lists.jump-project.org
> [mailto:jts-devel-bounces at lists.jump-project.org] On Behalf
> Of Mateusz Loskot
> Sent: April 17, 2006 1:41 PM
> To: jts-devel at lists.jump-project.org
> Subject: [jts-devel] A comment to JTS Technical Specification
>
>
> 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
>
> _______________________________________________
> jts-devel mailing list
> jts-devel at lists.jump-project.org
> http://lists.refractions.net/mailman/listinfo/jts-devel
>
More information about the jts-devel
mailing list