Skip to content

Conversation

@amuttsch
Copy link

@amuttsch amuttsch commented Oct 21, 2025

Very small double values that contain three or more zeros after the dot (like 0.000123) have a string representation of 1.23E-4. The readPointWkt did not account for this and set the end pos to the E, thus the BigDecimal tried to parse "1.23E". This resulted in a NumberFormatException.

This fixes the issue by also allowing the minus sign when determining the end of the number.

Please backport this fix to version 12, thanks!

Fixes #2820

Very small coordinates that contain three or more zeros after the dot (like 0.000123) have a string representation of 1.23E-4. The readPointWkt did not account for this and set the end pos to the E, thus the BigDecimal tried to parse "1.23E". This resulted in a NumberFormatException.

This fixes the issue by also allowing the minus sign when determining the end of the number.
@divang divang added the Under Review Used for pull requests under review label Oct 22, 2025
divang added a commit that referenced this pull request Nov 26, 2025
…2837)

Very small coordinates that contain three or more zeros after the dot (like 0.000123) have a string representation of 1.23E-4. The readPointWkt did not account for this and set the end pos to the E, thus the BigDecimal tried to parse "1.23E". This resulted in a NumberFormatException.

Co-authored-by: Andreas Muttscheller <[email protected]>
@divang
Copy link
Contributor

divang commented Nov 26, 2025

Thank you @amuttsch for contributing to this fix.
For community PRs, we follow a process where, instead of merging directly, we create internal PRs based on your contributions. This is because we run a set of internal tests which cannot be executed with external PRs. We use our template format for the PR description, validate the tests, and then proceed with the merge.

Your contribution is valuable and is reflected in the internal PR linked (#2837).

Thank you again for your valued input!

@divang divang closed this Nov 26, 2025
@amuttsch
Copy link
Author

Awesome, thank you @divang !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Under Review Used for pull requests under review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Creating a Geography with very small coordinates causes a NumberFormatException

3 participants