[postgis-devel] PostGIS 1.4 SVN geometry parser hints

Mark Cave-Ayland mark.cave-ayland at siriusit.co.uk
Wed Oct 15 13:28:35 PDT 2008


Paul Ramsey wrote:
> Parse errors near the front lose context... and the position number is
> off a bit.
> 
> postgis2=# select 'MULTIPOYGON(((0 0, 0 0, 0 0,0 0),(0 0, 0 0, 0 0,0
> 0),(0 0, 0 0, 0 0,0 0),(0 0, 0 0, 0 0,0 0),(0 0, 0 0, 0 0,0
> 0)))'::geometry;
> ERROR:  parse error - invalid geometry
> HINT:  "" <-- parse error at position 0 within geometry

I think this is because MULTIPOLYGON is a token in the grammar, and so 
since the first token doesn't match the current position is still zero 
when the error occurs. I'm not sure if there is a way of getting the 
current character offset from within flex at this point...


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