[postgis-users] Upgrading PostGis: parsing geometries

strk at refractions.net strk at refractions.net
Sat Aug 27 09:25:46 PDT 2005


Guido, would you file a bug report for this ?
It would remind me about it and be eventualy fixed...

	http://postgis.refractions.net/bugs
	
Thanks, --strk;

On Fri, Aug 26, 2005 at 02:20:52PM +0200, Guido Lemoine wrote:
> Hi all,
> 
> While upgrading to postgresql 8 and postgis 1.0.3 I came across the 
> following
> problems. They appear to be due to a change in the parser of the text 
> strings
> that build up the geometries. These problems did not exist before (< 1.0.x).
> 
> select SetSRID('BOX3D(10 20 , 30 40)'::box3d, 4326);
> ERROR:  BOX3D parser - couldnt parse.  It should look like: BOX3D(xmin 
> ymin zmin,xmax ymax zmax) or BOX3D(xmin ymin,xmax ymax)
> 
> This is because there is a space after 20 just before the comma. You'd 
> expect the
> parser to do some trimming before parsing.
> 
> The other one is far more annoying, however:
> 
> select geometryfromtext('POINT(34. 22.)', 4326);
> ERROR:  parse error - invalid geometry
> 
> however, if you add a 0 after the decimal point (or remove the decimal 
> point),
> it works:
> 
> Positions=# select geometryfromtext('POINT(34.0 22.0)', 4326);
>                 geometryfromtext
> ----------------------------------------------------
> 0101000020E610000000000000000041400000000000003640
> (1 row)
> 
> A float without a trailing 0 is parsable in any normal programming
> language. It's a real pain.
> 
> Guido Lemoine
> 
> 
> 
> _______________________________________________
> postgis-users mailing list
> postgis-users at postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-users



More information about the postgis-users mailing list