Skip to content
This repository was archived by the owner on Oct 1, 2024. It is now read-only.

Fix coordinate precision #173

Merged
merged 4 commits into from
Jun 14, 2022

Conversation

scottlimmer
Copy link
Contributor

PR to address Coordinate precision lost #167

Constructor reads value from config or defaults to 6 (the default precision for sprintf). It is not anticipated that users will want to customise precision for an individual point, so no argument has been added to the constructor signature.

A setter is provided for the precision property, though this is primarily to enable tests. If users do need to set precision for an individual point, the setter may be used.

stringifyFloat has been converted to dynamic function to ease testing. It was only ever called from a non-static context anyway.

Added tests, default config and updated readme

Constructor reads value from config/postgis.php:precision or defaults to 6 (the default precision for sprintf). It is not anticipated that users will want to customise precision for an individual point, so no argument has been added to the constructor signature.

A setter is provided for precision, though this is primarily to enable tests. If users do need to set precision for an individual point, the setter may be used.

stringifyFloat has been converted to dynamic function to ease testing. It was only ever called from a non-static context anyway.
@mstaack mstaack merged commit cd19db2 into mstaack:master Jun 14, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants