Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bounds will give wrong true extend boundaries depending on data load sequence #82

Open
GoogleCodeExporter opened this issue Sep 21, 2015 · 0 comments

Comments

@GoogleCodeExporter
Copy link

What steps will reproduce the problem?
1. Create a Point that should be the value for "r" (right) 
2. Create a Bounds and call extend() on the point
3. Call extend() again on a new point that is not as far "r" 

What is the expected output? What do you see instead?
The "right" should have the value of the first point .. not a later one.  The 
first Point after a new Bounds() should set all 4 parameters ... it winds up 
only setting 2. 

What version of the product are you using? On what operating system?
1.2.0 ... Mac OS X 

Please provide any additional information below.

-- Here is my fix based on using a overridden method for the extend() method. 
Not the lack of else if {} since a point could satisfy both requirements ... 

    @Override
    public void extend(Point p) {
        double lon = p.getLon();
        if (lon < super.getLeft()) {
            super.setLeft(lon) ;
        }
        if (lon > super.getRight()) {
            super.setRight( lon );
        }
        double lat = p.getLat();
        if (lat < super.getBottom()) {
            super.setBottom( lat );
        }
        if (lat > super.getTop()) {
            super.setTop( lat );
        }
        // TODO figure out how to behave on poles and in date line
    }

Original issue reported on code.google.com by [email protected] on 6 Aug 2012 at 6:01

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant