Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ST_AsText : adding optional argument 'precision' #94

Closed
wants to merge 1 commit into from
Closed

ST_AsText : adding optional argument 'precision' #94

wants to merge 1 commit into from

Conversation

marcu
Copy link

@marcu marcu commented Feb 24, 2016

The optional argument 'precision' is used for specifying the number of significant digits in the output doubles

…umber of significant digits in the output doubles
@mwtoews
Copy link
Contributor

mwtoews commented Feb 24, 2016

This is related to http://trac.osgeo.org/postgis/ticket/407 enhancement idea, which woud use extra_float_digits for all ST_As* fuctions. I wonder if a default should be obtained from that global.

@dbaston
Copy link
Member

dbaston commented Feb 25, 2016

Ideally ST_AsText would behave similarly to other text-producing functions....so the current output of POINT(1.1e+02 1.1) in the doc example should be 111.11 to be consistent with functions like ST_AsKML and ST_AsGeoJSON.

@dbaston
Copy link
Member

dbaston commented Feb 25, 2016

I wonder if a default should be obtained from that global.

Whether we need/want to change the defaults is probably outside the scope of this improvement.

@mwtoews
Copy link
Contributor

mwtoews commented Feb 25, 2016

Right, setting defaults is not directly related to this enhancement, and should be ignored here.

@vesnikos
Copy link

At some cases, the scientific format might cause some issues. See
http://gis.stackexchange.com/questions/190732/postgis-floating-point-representation-problem-with-st-astext

@robe2
Copy link
Member

robe2 commented May 20, 2017

Are we done with discussion of this? Is this ready for commit?

@Komzpa
Copy link
Member

Komzpa commented Dec 26, 2017

To get this merged we need:

  • ticket in trac
  • rebase on trunk
  • change precision to mean "number of signs after the point" similar to ST_AsGeoJSON
  • get rid of scientific format, test on values too large (100000000000) and too small (0.000000001)

@marcu do you need any help with that? :)

@@ -66,3 +66,5 @@ geojson_options_13|{"type":"LineString","crs":{"type":"name","properties":{"name
geojson_options_14|{"type":"LineString","crs":{"type":"name","properties":{"name":"urn:ogc:def:crs:EPSG::4326"}},"coordinates":[[1,1],[2,2],[3,3],[4,4]]}
geojson_options_15|{"type":"LineString","crs":{"type":"name","properties":{"name":"urn:ogc:def:crs:EPSG::4326"}},"bbox":[1,1,4,4],"coordinates":[[1,1],[2,2],[3,3],[4,4]]}
geojson_options_16|{"type":"LineString","crs":{"type":"name","properties":{"name":"urn:ogc:def:crs:EPSG::4326"}},"bbox":[1,1,4,4],"coordinates":[[1,1],[2,2],[3,3],[4,4]]}
text_precision_01|POINT(111.1111111 1.1111111)
text_precision_02|POINT(1.1e+2 1.1)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is 1.1e+2 a desired result in this case?

@Komzpa
Copy link
Member

Komzpa commented Jan 14, 2018

@Komzpa
Copy link
Member

Komzpa commented Jan 14, 2018

@marcu I did the switch from "number of significant digits" to "number of digits after comma" in #190. Are you available for a rebase of this PR on top of that one? :)

@Komzpa
Copy link
Member

Komzpa commented Jan 17, 2018

Let's go to #194 which has the branch rebased. (wow, exactly 100 pull requests later!)

@Komzpa Komzpa closed this Jan 17, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
6 participants