star-mercator 0.1.0
Mercator on the ellipsoid, and Web Mercator
Public state: Released & Verified. The registry label is RELEASED. What the states mean →
Apache-2.0 Released & Verified single file
Summary
Mercator projection on the ellipsoid with optional latitude of true scale, forward, inverse and scale factor, and Web Mercator; within 6e-8 m of PROJ, 7.5e-9 m of PyGeodesy's isometric latitude and 3e-8 m of both for Web Mercator on 600 cases; reproduces Snyder's published x and scale factor.
Run in your browser
Edit the code and press Run (or Ctrl+Enter). Python runs in your browser with this package's published code. The first run downloads Python once (about 12 MB).
Runs in the browser: all 73 tests pass in the browser's Python (Pyodide 314.0.7, Python 3.14.2), measured on 20 October 2026.
Use it on your computer
No account and no GitHub needed. Download, then install with one command:
- Install file · star_mercator-0.1.0-py3-none-any.whl 3 kB
- Single file — copy it alongside your code · star_mercator.py 5 kB
- Source code (.zip) 23 kB
python -m pip install star_mercator-0.1.0-py3-none-any.whlIn Python: import star_mercator
Cite it, and its bill of materials
For a paper, a report or a supplier file: the citation in two formats, and the software bill of materials (SBOM) in the two standard formats, with the fingerprint of the wheel.
@software{cavazzini_star_mercator_0_1_0,
author = {Cavazzini, Andrea},
title = {{star-mercator}: Mercator on the ellipsoid, and Web Mercator},
version = {0.1.0},
year = {2026},
url = {https://andrea07072000.github.io/S.T.A.R.-/software/star_mercator/},
note = {Apache-2.0. Source: https://github.com/Andrea07072000/S.T.A.R.-, commit dc09f61d}
}
For developers
Install directly from the public repository:
python -m pip install "star-mercator @ git+https://github.com/Andrea07072000/S.T.A.R.-.git@dc09f61dcee098d518f070d6a23a8815defc1109#subdirectory=packages/star_mercator"
Technical sheet
Requirements
- R1
mercator_forward,mercator_inverse: the conformal Mercator of the ellipsoid, y = a·k0·ψ with ψ the isometric latitude written without cancellation, any central meridian, an optional latitude of true scale. Reproduce the x of Snyder's numerical example (USGS PP 1395, p. 266) to the printed 0.1 m. - R2
mercator_scale: point scale factor, 1 on the parallels of true scale. Reproduces Snyder's k = 1.2194146.web_mercator_forward,web_mercator_inverse: EPSG:3857. - R3 Measured on 600 cases on WGS-84 (latitudes to ±89, true scale to ±80): forward within 5.5e-8 m and inverse within 6e-8 m of PROJ; y within 7.5e-9 m of PyGeodesy's isometric latitude; Web Mercator within 3e-8 m of PROJ and PyGeodesy; scale within 7.5e-8 of PROJ (whose factors are numerical).
- R4 Every function returns finite floats or raises
ValueError: non-numeric, boolean, NaN or infinite input, latitude beyond ±89.5, latitude of true scale beyond ±80, longitudes beyond ±180, an ellipsoid outside the stated ranges, plane coordinates beyond the image. Inverse longitudes are in [-180, 180).
Limits (what is not claimed)
Web Mercator is not conformal and its y differs from the ellipsoidal Mercator by tens of kilometres at mid-latitudes: do not mix them. PyGeodesy has no ellipsoidal Mercator: it confirms the isometric latitude (hence y) and Web Mercator, not x or the scale; and it refuses Web Mercator beyond 85.05 deg, so 19 of the 600 cases were compared with PROJ only. The y of Snyder's example is not cited: its last printed digit could not be confirmed. At longitude 180 exactly web_mercator_forward returns the East edge (+20037508.34 m) while mercator_forward reduces the difference from its central meridian to [-180, 180) and returns the West edge. No rhumb-line distances or bearings.
Release gate
Computed by the registry from the result files, with the same function that decides RELEASED.
- Mutation score, latest measure of each module (needs at least 0.850)
- star_mercator.py 0.939 (2026-10-06)
- Independent implementations written by others (needs 2)
- PROJ +proj=merc / webmerc and get_factors (C), PyGeodesy Ellipsoid.auxIsometric and webmercator.toWm (Python)
- Also compared with, not counted
- published values: Snyder, USGS PP 1395, p. 266
- Result
- Released & Verified
Evidence in the registry
| Check | Status | Recorded | What was observed |
|---|---|---|---|
| Clean install from the release tag | VERIFIED | 2026-10-06 | pytest outside the tree: 73 passed in 0.25s |
| Unit tests | VERIFIED | 2026-10-06 | 73 passed in 0.49s |
| Review | VERIFIED | 2026-10-06 | Requirements, interface, units, data provenance, dependency surface and failure behaviour reviewed |
| Review | VERIFIED | 2026-10-06 | Re-running the cross-check gives a byte-identical evidence file |
| Reference value | VERIFIED | 2026-10-06 | x = 11688673.715, k = 1.21941461: within 0.015 m and 8.4e-9 of the printed values (suite: 73 passed in 0.49s) |
| Cross-check with independent libraries | VERIFIED | 2026-10-06 | star_mercator reproduces the ellipsoidal Mercator of PROJ for any latitude of true scale, its isometric latitude agrees with PyGeodesy, and Web Mercator agrees with both |
| Benchmark | VERIFIED | 2026-10-06 | ellipsoidal: PROJ 5.5e-08 m; isometric latitude: PyGeodesy 7.5e-09 m; web: 3.0e-08 m |
Fingerprints (SHA-256)
| star_mercator-0.1.0-py3-none-any.whl | 041758ecb84df5944bae264e4497563c504c32c1f0e4fb4dcc492baa4c7fc5a1 |
| star_mercator.py | 427352ea5cee6cebcdc716dce4ed52cf736ae5262d9e21e01c3c54c4f7bc37ee |
| star_mercator-0.1.0-source.zip | c2fffe52f5aeef49e7235a062b74c81971cd6ed73d9a7632f38e01054dd8a378 |
