Bug fixes for WKT handling

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

Bug fixes for WKT handling

Martin Davis

There are a couple of long-standing flaws in the way JTS implements the
WKT spec.  I'd like to address this in version 1.11.  I thought I'd
describe them in the list, so that if anyone has concerns or other ideas
they can raise them.

The issues are:

1) WKT allows the following syntax for multi-geometries:


(e.g. a MultiPolygon containing 3 empty Polygons - which is distinct

JTS doesn't support reading or writing this syntax.  This is arguably a
bizare corner case, which I've never seen in the wild.  Nevertheless, I
think it would be good to support it.  I don't expect this change to be
noticed by anyone.

2) This one is bigger.  The WKT syntax for MultiPoint is:

MULTIPOINT ((1 1), (2 2), (3 3))

JTS currently has this wrong - it uses MULTIPOINT (1 1, 2 2, 3 3). (In
my defence the original spec used this syntax for examples - which is
why the mistake was made in the first place).

I'd like to switch to using the correct syntax. My plan is to continue
to allow the old JTS syntax for reading, but always emit the correct
syntax for writing.

Comments, concerns?

Martin Davis
Senior Technical Architect
Refractions Research, Inc.
(250) 383-3022

jts-devel mailing list
[hidden email]