Closed natassaf closed 1 year ago
I suspect they're equivalent. I couldn't make never mind, I made a typo, but I guess they're almost the same thing anyway, but consider:cs2cs
work with OGC:CRS84
$ echo "-26471262.0 3462994.0" | cs2cs EPSG:3395 EPSG:4326 -f "%.8f"
29.84979984 122.20460755 0.00000000
$ echo "29.84979984 122.20460755" | cs2cs EPSG:4326 EPSG:3395 -f "%.8f"
13603754.68505784 3462993.99969395 0.00000000
$ echo "13603754.68505784 3462993.99969395" | cs2cs EPSG:3395 EPSG:4326 -f "%.8f"
29.84979984 122.20460755 0.00000000
# same point
Keep in mind that your point appears to be outside of the EPSG:3395
bounds:
$ projinfo EPSG:3395
PROJ.4 string:
+proj=merc +lon_0=0 +k=1 +x_0=0 +y_0=0 +datum=WGS84 +units=m +no_defs +type=crs
WKT2:2019 string:
PROJCRS["WGS 84 / World Mercator",
BASEGEOGCRS["WGS 84",
ENSEMBLE["World Geodetic System 1984 ensemble",
MEMBER["World Geodetic System 1984 (Transit)"],
MEMBER["World Geodetic System 1984 (G730)"],
MEMBER["World Geodetic System 1984 (G873)"],
MEMBER["World Geodetic System 1984 (G1150)"],
MEMBER["World Geodetic System 1984 (G1674)"],
MEMBER["World Geodetic System 1984 (G1762)"],
MEMBER["World Geodetic System 1984 (G2139)"],
ELLIPSOID["WGS 84",6378137,298.257223563,
LENGTHUNIT["metre",1]],
ENSEMBLEACCURACY[2.0]],
PRIMEM["Greenwich",0,
ANGLEUNIT["degree",0.0174532925199433]],
ID["EPSG",4326]],
CONVERSION["World Mercator",
METHOD["Mercator (variant A)",
ID["EPSG",9804]],
PARAMETER["Latitude of natural origin",0,
ANGLEUNIT["degree",0.0174532925199433],
ID["EPSG",8801]],
PARAMETER["Longitude of natural origin",0,
ANGLEUNIT["degree",0.0174532925199433],
ID["EPSG",8802]],
PARAMETER["Scale factor at natural origin",1,
SCALEUNIT["unity",1],
ID["EPSG",8805]],
PARAMETER["False easting",0,
LENGTHUNIT["metre",1],
ID["EPSG",8806]],
PARAMETER["False northing",0,
LENGTHUNIT["metre",1],
ID["EPSG",8807]]],
CS[Cartesian,2],
AXIS["(E)",east,
ORDER[1],
LENGTHUNIT["metre",1]],
AXIS["(N)",north,
ORDER[2],
LENGTHUNIT["metre",1]],
USAGE[
SCOPE["Very small scale conformal mapping."],
AREA["World between 80°S and 84°N."],
BBOX[-80,-180,84,180]],
ID["EPSG",3395]]
$ echo "-80 -180" | cs2cs EPSG:4326 EPSG:3395 -f "%.8f"
-20037508.34278924 -15496570.73972372 0.00000000
# -26471262.0 < -20037508.34278924
Have you confirmed that the result is correct when run with someone else got there first. cs2cs
?
Yeah, see my edit:
$ echo "-26471262.0 3462994.0" | cs2cs EPSG:3395 EPSG:4326 -f "%.8f"
29.84979984 122.20460755 0.00000000
$ echo "13603754.68505784 3462993.99969395" | cs2cs EPSG:3395 EPSG:4326 -f "%.8f"
29.84979984 122.20460755 0.00000000
Note for random readers: spatialreference.org (e.g.) has the projected bounds for the area of use, don't do it the hard way like I did.
Thank you guys! Indeed I believe the issue is that the initial EPSG:3395 coordinates is out of bounds!
Below there is a test in rust that fails. The proj version used is the latest as of today, proj = "0.27.0"