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

Error in validate.CleanGeometry on fractional coordinates #12

Open
ARolek opened this issue May 18, 2018 · 0 comments
Open

Error in validate.CleanGeometry on fractional coordinates #12

ARolek opened this issue May 18, 2018 · 0 comments

Comments

@ARolek
Copy link
Member

ARolek commented May 18, 2018

This is copied from tegola #338


The test case for this can be found here.

To run this:

  • checkout the intersect_benchmark branch from my repo
  • cd tegola/maths/validate
  • Run: go test -v .

At this time the test is only printing results and isn't flagging the tests as failures.

Input polygon and extent:

// fractional coordinate
// if you multiply everything by 10 (remove fraction), then this test case
// works just fine.
{
	basic.Polygon { basic.Line {
			basic.Point {.1, 0},
			basic.Point {1, 0},
			basic.Point {0, 1},
	} },
	geom.NewExtent([2]float64{0, 0}, [2]float64{.5, .5}),
},

The winding order and POLYGON vs. MULTIPOLYGON aren't really relevant, the relevant part is (0.05, .5) point vs (0, 0.5) point.

Expected: POLYGON ((0.5 0,0.1 0,0.05 0.5,0.5 0.5))
Actual: MULTIPOLYGON (((0 0.5,0.1 0,0.5 0,0.5 0.5)))

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

1 participant