Code Monkey home page Code Monkey logo

Comments (4)

pomadchin avatar pomadchin commented on July 22, 2024

Hi @gwlucastrig, I'd be happy to help you with whatever approach. Making a PR could be a good starting point, if you have a need why not to try to get it fixed!

from proj4j.

gwlucastrig avatar gwlucastrig commented on July 22, 2024

Thanks. I'll take a look at the math and see how it fits within the existing code framework. I would want to make sure I could do something consistent with what you've already got. If I can do that, I'll submit a PR.

from proj4j.

gwlucastrig avatar gwlucastrig commented on July 22, 2024

I found the solution, no code changes required. The StereographicAzimuthalProjection has methods called setTrueScaleLatitude() and setTrueScaleLatitudeDegrees() that can be used to set the latitude at which the map scale will be true (1.0). Since the latitude at which I needed for the scale to be true was 75 degrees north, I used the following:

    Datum datum = Datum.WGS84;
    Ellipsoid ellipsoid = datum.getEllipsoid();
    StereographicAzimuthalProjection p = new StereographicAzimuthalProjection(Math.PI / 2, 0);
    p.setEllipsoid(ellipsoid);
    p.setTrueScaleLatitudeDegrees(75.0);
    p.initialize();

This does have the effect of making calls to initialize multiple times (it's called inside the constructor and by the application code), but it gets the job done. Incidentally, the latitude of true scale for Universal Polar Stereographic is approximately 81.11451786859362545 (Wikipedia). So I tested this approach by modifying my program to take that as the argument for setTrueScaleLatitudeDegrees() and comparing it to the results I got when using the setupUps() method provided by the projection class.

Unless you want additional information, I intend to close this issue.

from proj4j.

gwlucastrig avatar gwlucastrig commented on July 22, 2024

Incidentally, I notice that in Registry.java, there is an entry for Universal Transverse Mercator (UTM), but the one for Universal Polar Stereographic (UPS) is a commented-out placeholder. It would be straightforward to write a class for UPS derived from StereographicAzimuthalProjection with the appropriate constructor.

from proj4j.

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.