[postgis-devel] WKT Parser changes for Curve support

Mark Cave-Ayland mark.cave-ayland at siriusit.co.uk
Tue Feb 3 05:39:29 PST 2009


Mark Leslie wrote:

> I've cobbled together a quick RFC describing some changes I'd like to 
> impose upon the parser in order to support the CompoundCurve and 
> CurvePolygon properly.  I've committed it to trunk: 
> http://svn.refractions.net/postgis/trunk/doc/rfc/postgis_rfc_04.txt
> 
> The short summary is that our practise of using global variables to 
> define constraints such as minimum number of points or ring closure no 
> longer work once we start dealing with nesting of multiple geometry 
> types and constraints between sub-geometries, such as checking the 
> continuity of a compound curve.
> 
> My proposed change moves the validation to the level of a complete 
> geometry, instead of validating each point array on completion.  The 
> down sides are that it will need to traverse the list of tuples to 
> properly validate which can only degrade performance, and it will no 
> longer report which point array is in violation of a given constraint, 
> only which geometry.
> 
> Please have a look at the rfc and share any comments you have.


Hi Mark,

I've had a read of the RFC and must admit I'm not happy about losing 
positional information in the geometry - this has helped me several 
times in testing, and this is before it's even hit any live servers.

I agree that the use of global variables in the parser is particularly 
bad and would love to see them go. My thoughts at the moment are that it 
would make more sense to push the constraints onto the stack (i.e. add 
an extra field to the tuple) so that when you reach the end of an inner 
geometry, a pop/popc() call would check the existing constraints and 
then restore the previous ones.


ATB,

Mark.

-- 
Mark Cave-Ayland
Sirius Corporation - The Open Source Experts
http://www.siriusit.co.uk
T: +44 870 608 0063



More information about the postgis-devel mailing list