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

Two polygon nodes are not always split correctly #38

Open
andymstone opened this issue May 6, 2020 · 1 comment
Open

Two polygon nodes are not always split correctly #38

andymstone opened this issue May 6, 2020 · 1 comment

Comments

@andymstone
Copy link

I think there is a bug in TimeZoneMapperConverter.split2Polys where it splits a node with 2 non-overlapping polygons into 2 pure nodes. It works out if it can do the split on longitude/latitude, but then it always assigns poly1 to left and poly2 to right, but I think actually in the first branch of the if statement (if (box1.lat1 > box2.lat2)) you should assign the polygons the otherway around? Since poly1 is north of poly2 it should be assigned to right? Similarly in the 3rd branch where poly1 is east of poly2.

The result of this error is cases like (65.842400, -52.665800) which should have time zone America/Godthab but doesn't because the wrong polygon ended up in the leaf node.

@tom-b-wright
Copy link

tom-b-wright commented May 7, 2020

Seems legit.

Hope that someone can fix this.


@Test @Ignore
public void testIssue38() {

        assertEquals("America/Godthab", TimezoneMapper.latLngToTimezoneString(65.842400, -52.665800));
        assertNotEquals("America/Goose_Bay", TimezoneMapper.latLngToTimezoneString(65.842400, -52.665800));

}

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

No branches or pull requests

2 participants