[geos-devel] RE: handling newlines in WKT

Yury A. Bychkov ybychkov at direct.ca
Thu Oct 31 02:38:07 EST 2002


I've fixed my StreamTokenizer and now XMLTester can execute all those tests with
newlines. CVS has been updated.

Yury


----- Original Message -----
From: "Martin Davis" <mbdavis at VividSolutions.com>
To: <geos-devel at geos.refractions.net>
Sent: Wednesday, October 30, 2002 2:22 PM
Subject: [geos-devel] RE: handling newlines in WKT


Ok, mystery resolved.  WKTReader.java indeed throws Exceptions if it encounters
newline tokens - but it will never encounter any such tokens!  The default
configuration of the StreamTokenizer is to translate newlines to whitespace, and
that's how JTS uses it.

So the correct semantics for the WKTReader is to treat newlines as whitespace.
Yury, whatever you used to tokenize the WKT stream should follow these
semantics.

Martin Davis, Senior Technical Specialist
Vivid Solutions Inc.
Suite #1A-2328 Government Street   Victoria, B.C.   V8T 5G5
Phone: (250) 385 6040    Fax: (250) 385 6046
EMail: mbdavis at vividsolutions.com  Web: www.vividsolutions.com


> -----Original Message-----
> From: Yury A. Bychkov [mailto:ybychkov at direct.ca]
> Sent: Wednesday, October 30, 2002 2:13 PM
> To: geos-devel at geos.refractions.net
> Subject: Re: [geos-devel] Linux Compilation
>
>
> That was strange to me too. I haven't seen the source for
> TestRunner, so I can't
> know for sure, but the only possibility that I can think of
> is that it doesn't
> use WKTReader from 'io' package. If you'll look at lines 177
> and 264 in
> WKTReader.java, it throws an exception if it encounters EOL.
>
> Yury
> ----- Original Message -----
> From: "Martin Davis" <mbdavis at VividSolutions.com>
> To: <geos-devel at geos.refractions.net>
> Sent: Wednesday, October 30, 2002 1:56 PM
> Subject: RE: [geos-devel] Linux Compilation
>
>
> I'm not sure I understand here....  I think that the JTS
> TestRunner must ignore
> newlines, since we run the test files just as they are.  Is
> it possible that
> this has been overlooked in the port?
>
> Martin Davis, Senior Technical Specialist
> Vivid Solutions Inc.
> Suite #1A-2328 Government Street   Victoria, B.C.   V8T 5G5
> Phone: (250) 385 6040    Fax: (250) 385 6046
> EMail: mbdavis at vividsolutions.com  Web: www.vividsolutions.com
>
>
> > -----Original Message-----
> > From: Yury A. Bychkov [mailto:ybychkov at direct.ca]
> > Sent: Wednesday, October 30, 2002 1:33 PM
> > To: geos-devel at geos.refractions.net
> > Subject: Re: [geos-devel] Linux Compilation
> >
> >
> > > With a little perl and a foreach I cleaned up the JTS1.2
> > test xml files
> > > sufficiently to run them all. There were no failures at all
> > in the GNU
> > > Linux compilation!
> > Great.
> >
> > > > Now, I started trying running the tests... the
> XMLTester is really
> > > > fragile! Is this the tester you are using Yury, or do you
> > have a private
> > > > one hidden at home?
> > I am using the same tester and yes, it is rather fragile.
> > However I used an
> > exact copy of JTS WKTReader and didn't modify it because I
> > wasn't sure if I
> > should do it.
> >
> > > > As it stands, any WKT defined with newlines in it
> crashes the WKT.
> > > > Since all the JTS test XML files are formatted this way,
> > > > it makes it laborious to run the tests here :)
> > I did the same thing as you (with perl) and just reformatted
> > the test files.
> >
> > Yury
> >
> >
> >
> > _______________________________________________
> > geos-devel mailing list
> > geos-devel at geos.refractions.net
> > http://geos.refractions.net/mailman/listinfo/geos-devel
> >
>
> _______________________________________________
> geos-devel mailing list
> geos-devel at geos.refractions.net
> http://geos.refractions.net/mailman/listinfo/geos-devel
>
>
>
>
>
> _______________________________________________
> geos-devel mailing list
> geos-devel at geos.refractions.net
> http://geos.refractions.net/mailman/listinfo/geos-devel
>

_______________________________________________
geos-devel mailing list
geos-devel at geos.refractions.net
http://geos.refractions.net/mailman/listinfo/geos-devel








More information about the geos-devel mailing list