Giter Club home page Giter Club logo

Comments (3)

AliFlux avatar AliFlux commented on August 16, 2024

Hi.

Can you please share a snippet about how you are using this proj4 to transform the coordinates?
I think the issue is with the always_xy parameter of Proj. In newer versions the axis orientation can be flipped.

from epsg.io.

tvartom avatar tvartom commented on August 16, 2024

Thanks for looking into ths.

I'm using proj4js and the proj4js-definition from https://epsg.io/3021.js.

According to http://proj4js.org/#:~:text=4326%27))%3B-,Axis%20order,-By%20default%2C%20proj4
the default is always [x=longitude,y=latitude].
My code is only using this order in the code, and not setting the enforceAxis.

(Note that the presentation of RT90 coordinates is a bit confusing with X,Y where X=Northing and Y=Easting)

npm install proj4

import proj4 from "proj4";

// Defs from https://epsg.io/3021.js
proj4.defs("EPSG:3021","+proj=tmerc +lat_0=0 +lon_0=15.8082777777778 +k=1 +x_0=1500000 +y_0=0 +ellps=bessel +towgs84=414.1,41.3,603.1,0.855,-2.141,7.023,0 +units=m +no_defs +type=crs");
const [ew, ns] = [1654936, 6404561]; //Lummelunda Cave, Gotland in EPSG:3021 (RT90)
const [lon, lat] = proj4("EPSG:3021", "EPSG:4326", [ew, ns]);
console.log([lon,lat]); // prints: [ 18.41059513866261, 57.74033121915699 ] 265 meters off
// Should be: [ 18.40681206572018, 57.73905641421247 ]

Using proj4js version 2.8.0

from epsg.io.

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.