[postgis-users] Formatting for small Well Known Text coordinates

Chris Holmes cholmes at openplans.org
Mon Mar 17 11:25:16 PST 2003


Apologies if this has been addressed before, but I searched a bit in the
archives and didn't find anything.  I've been working with the JTS
WKTWriter and the Postgis AsText function, and I'm unclear on the proper
format for WKT for small numbers.  Both Postgis and JTS express numbers
smaller than e-4 or e-5 in scientific notation.  Is this valid Well Known
Text?  I ask because as far as I can tell the JTS WKTReader fails to read
things correctly if it comes across something like 2.0E-4.  This is a
problem if you use the wkt reader with postgis for small numbers, since
postgis's AsText ouputs number smaller than e-5 in scientific notation.  
The simple features for sql spec in section 3.2.5.2 says that points a
point <x> := 'double precision literal'.  And section 3.2.5.3 has examples
of integer values, but says 'coordinates may be any double precision
value.' So is 2.0E-4 a valid WKT coordinate?  The WKTWriter also uses a
similar format when writing out WKT, making it so the WKTReader can't read
everything that the WKTWriter writes. Or am I doing something wrong?  Is
there a way to force postgis/jts to output in standard notation?

thanks,

    Chris











More information about the postgis-users mailing list