Code Monkey home page Code Monkey logo

Comments (6)

paulushub avatar paulushub commented on August 24, 2024 1

@pomadchin I think the comments to the Projection.initialize() method says a lot about its uses.

    /**
     * Initialize the projection. This should be called after setting parameters and before 
     *  using the projection.
     * This is for performance reasons as initialization may be expensive.
     */
    public void initialize() {
        spherical = (e == 0.0);
        one_es = 1-es;
        rone_es = 1.0/one_es;
        totalScale = a * fromMetres;
        totalFalseEasting = falseEasting * fromMetres;
        totalFalseNorthing = falseNorthing * fromMetres;
    }

Looking at the codes, the projections that require further initialization override this method and in all cases call the base method.

The easiest way to manage such project is to file known issues as tasks, otherwise, it is not obvious when you download the sources. I have done that with my current project on GitHub
SharpVectors/issues

I am running into these issues, because I started porting it to .NET/C#, which gives me the opportunity to look at the sources file by file, and I am filing these issues to draw attention to them.

from proj4j.

pomadchin avatar pomadchin commented on August 24, 2024

The story is that lots of projections (i.e. LandsatProjection) require some love as well as the entire project code (actually we're an open source project, you can help us). We know that there are lot's of issues with the codebase.

In case of initialize, I'm pretty sure 1. it is not required in all the cases, and I don't see how did you figure out that it is required everywhere - all projections rely on different parameters. Mb only from the code hygiene point. 2. the LandsatProjection doesn't properly work.

from proj4j.

pomadchin avatar pomadchin commented on August 24, 2024

@paulushub are you sure that all projections use
spherical, one_es, rone_es, totalScale, totalFalseEasting, totalFalseNorthing?

For instance Landsat uses none of these parameters => that is why the lack of this call won't break anything. Mb for the code hygiene purposes it makes sense to make code more readable though.

I'm pretty sure that all non standard projections don't use common parameters and it can explain the lack of init method and lack of overrided constructors.

I see, here is the pointer to tests with non working projections we have a bunch of tests that are failing due to some bad math. Hope it will help you.

from proj4j.

pomadchin avatar pomadchin commented on August 24, 2024

Also I appreciate a lot all the issues created, thank you!

from proj4j.

paulushub avatar paulushub commented on August 24, 2024

@paulushub are you sure that all projections use

Possibly not, but since this is also a port of the C/C++ codes, it is safer to simply follow the pattern defined in the comment, rather than searching to find if a project/inverse needs that or not.

from proj4j.

pomadchin avatar pomadchin commented on August 24, 2024

I would like even to get rid of the init method tbh.

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.