Opened 11 years ago

Closed 11 years ago

#2146 closed defect (invalid)

ST_AsText returns 'e' as exponent

Reported by: yossi Owned by: pramsey
Priority: medium Milestone: PostGIS 2.0.3
Component: postgis Version: 2.0.x
Keywords: Cc:

Description

The following query:

select ST_AsText(ST_MakePoint(1E-7, 1e-8))

returns:

POINT(1e-007 1e-008)

I would expect it to return:

POINT(1E-007 1E-008)

As far as I can see capital E is the standard used in Postgres, as well as in standard defintions. Some floating point numbers fails on parsing as is, and in general since it is not clearly defined that it will always be 'e', it is more difficult to reliably parse.

Change History (3)

comment:1 by robe, 11 years ago

yossi which version of postgresql and postgis are you using. Please state the

SELECT version();
SELECT postgis_full_version();

I think the exponent issue varies between OS. On winodws I see the same as you, but that may mean nothing since as I recall when I've seen on linux I don't get the extra 0s

comment:2 by yossi, 11 years ago

Exponent issue tested on both Windows 7 and Amazon Linux (a RHEL variant). In Linux the result is:

POINT(1e-07 1e-08)

Non-capital e in both OSs, different number of leading zeroes (which is not a problem for me).

SELECT version(), postgis_full_version();
PostgreSQL 9.2.1 on x86_64-unknown-linux-gnu, compiled by gcc (GCC) 4.4.6 20120305 (Red Hat 4.4.6-4), 64-bit;POSTGIS="2.0.1 r9979" GEOS="3.3.5-CAPI-1.7.5" PROJ="Rel. 4.8.0, 6 March 2012" LIBXML="2.7.6"

comment:3 by robe, 11 years ago

Resolution: invalid
Status: newclosed

I'm going to dismiss this as an invalid request. If your issue is that it should be E because that is the standard for PostgreSQL, then I would have to point out this.

SELECT POWER(10,-20);

Which on my windows box returns:

1e-020

lowercase e. So I see no reason why the output from PostGIS should be upper case E when said function returns lowercase e.

Note: See TracTickets for help on using tickets.