[geos-devel] RE: WKB parser

Martin Davis mbdavis at VividSolutions.com
Thu May 5 11:55:15 EDT 2005


Ah, strk, you're being too hard on yourself.

Personally I think it's a good idea to support LINEARRINGs in WKT.
After all, it's a first-class datatype, and it's easy to provide this
support.

As for WKB, I think it would be easy to add to it as well - just add a
new code byte value.  However, this seems a wee bit more fraught with
peril, simply because in a binary format it isn't as easy to see what's
going on when things break.

However, I'm happy with the decision to NOT handle LINEARRINGs in WKB,
since there doesn't seem to be a clear use case for them.

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: strk [mailto:strk at keybit.net] 
> Sent: May 5, 2005 8:16 AM
> To: Martin Davis
> Cc: pramsey at refractions.net; geos-devel at geos.refractions.net
> Subject: Re: WKB parser
> 
> 
> I answer on geos-devel as I think community should be able to 
> partecipate in this.
> 
> On Fri, Apr 29, 2005 at 05:29:47PM -0700, Martin Davis wrote:
> > I don't think normalize is what you want to be looking at.
> > 
> > This was an issue with WKT as well - the SFS doesn't 
> specify a format 
> > for LinearRings. I just went ahead and made up my own. I guess we 
> > could do the same thing for WKB too - what do you think?  
> Or we could 
> > just say that LinearRings are not supported by WKB  (not 
> such a good 
> > decision, I guess).
> 
> I'm afraid that the presence of LINEARRING in GEOS-extended 
> WKT is all my fault, and I'm sorry about it :(
> 
> We shouldn't have done it, as ogc tests were failing for 
> exactly this reason. A LINEARRIN is a LINESTRING at all 
> effects, why bothering with a new definition ? It is ok to 
> have a derivation in an OO hierarchy as it can help encoding 
> constraints in calls such as polygon constructors, but I 
> think exporing this in WKT was a wrong choice. I wouldn't do 
> it again, so I vote for WKB representation of a LINEARRIN 
> *is* a LINESTRING.
> 
> Other thoughts ?
> 
> --strk;
> 
> > 
> > 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: strk [mailto:strk at keybit.net]
> > > Sent: April 29, 2005 8:26 AM
> > > To: Martin Davis
> > > Cc: Paul Ramsey
> > > Subject: Re: WKB parser
> > > 
> > > 
> > > Ok, I've been lame. It's compareTo() as used by XMLTester.
> > > Anyway there's another problem. Input geometries can be 
> > > LINEARRING, while output geometries (as parsed by WKB output 
> > > of input geometry) will become LINESTRING. The normalize() 
> > > method of geoms doesn't take care of this. Should it in 
> your opinion ?
> > > 
> > > --strk;
> > > 
> > > On Fri, Apr 29, 2005 at 04:15:43PM +0200, strk wrote:
> > > > I've about done with the WKB parser code.
> > > > In order to test it I need a function to test vertex-by-vertex
> > > > equality of geometries, to compare input and output ( INPUT -> 
> > > > WKBWrite -> WKBRead -> OUTPUT).
> > > > 
> > > > What function should I use ?
> > > > Is anything similar in JTS ?
> > > > (sorry if I'm being lame)
> > > > 
> > > > --strk;
> > > 
> 



More information about the geos-devel mailing list