Giter VIP home page Giter VIP logo

Comments (5)

lnicola avatar lnicola commented on August 24, 2024 2

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.

from proj.

lnicola avatar lnicola commented on August 24, 2024 1

I suspect they're equivalent. I couldn't make cs2cs work with OGC:CRS84 never mind, I made a typo, but I guess they're almost the same thing anyway, but consider:

$ 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

from proj.

urschrei avatar urschrei commented on August 24, 2024 1

Have you confirmed that the result is correct when run with cs2cs? someone else got there first.

from proj.

natassaf avatar natassaf commented on August 24, 2024 1

Thank you guys! Indeed I believe the issue is that the initial EPSG:3395 coordinates is out of bounds!

from proj.

lnicola avatar lnicola commented on August 24, 2024

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

from proj.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.