locationtech / locationtech/proj4j

Transforming from "EPSG:4326" to "EPSG:3857" results in precision error

Open
#104 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
Java
Stars
232
Forks
86
PR merge metrics
No merged PRs in 30d

Description

When transforming from WGS 84 "EPSG:4326" to WGS 84 / Pseudo-Mercator "EPSG:3857" with lon = 0.0 and lat = 0.0 the result is x = 0.0 and y = -7.081154551613622E-10.
The correct value for y should be 0.0, but there is a precision error. Apache SIS gives the correct result. The precision error is there with all other lon/lat inputs that I have tried.
I use Java 17 and proj4j 1.3.0.
Is there any explanation on this or plans for a fix?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

No source file or test is named. Start by reproducing the EPSG:4326 to EPSG:3857 transformation with Java 17 and proj4j 1.3.0 using lon = 0.0 and lat = 0.0, then inspect the projection path responsible for the y result. Done means the reported precision error is resolved and the stated transformation returns y = 0.0.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
data
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.