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

Where to look for help #14

Closed
fils opened this issue Oct 28, 2016 · 4 comments
Closed

Where to look for help #14

fils opened this issue Oct 28, 2016 · 4 comments

Comments

@fils
Copy link

fils commented Oct 28, 2016

I'm really interested in the S2 library for go. Based on some blog posts I have been playing with some code at https://github.com/OpenCoreData/ocdGarden/blob/master/s2test/main.go

Been making more questions than progress it seems. :)

Is there a Google Group or a slack channel or something where people can go to get help with the S2 Golang library?

@rsned
Copy link
Collaborator

rsned commented Oct 29, 2016

I'm not aware of any off hand. Polygons are still at the very primitive stage right now (as evidenced by the limit of one Loop per poly), but we are working on getting it more complete.

For checking for points being ordered CCW, there is also this:
https://github.com/golang/geo/blob/master/s2/point.go#L85

@fils
Copy link
Author

fils commented Oct 30, 2016

@rsned thanks...
I'll look that over. My polygons are simple, they are mostly just odd shaped rectangles for things like cruise paths or the like. No holes or other oddities.

I'm really impressed with S2 and think it could be exactly what I am after. I just don't want to dive into C or Java to get it. Go is more comfortable to me.

I'll see what I can do and what results I get. It just seems to me that I keep getting points returned that are outside the polygon even when I move the level to 30 (max?) and allowed grid size to large amounts like 3000 or more.

Is there a simple way to save and visualize the coverage that things like

rc2 := &s2.RegionCoverer{MaxLevel: 30, MaxCells: 3000}
    r2 := s2.Region(poly.CapBound())
    covering2 := rc2.Covering(r2)

generate? (assuming that is even the right question :) still learning )

@akhenakh
Copy link

akhenakh commented Oct 30, 2016

2 reasons:
A cover does not match exactly the shape of your polygon but uses rect or cap bound.

  • You are using a CapBound and not a RectBound, a rect bound could be me precise for rect polygons
  • In any case you have to perform a Point in Polygon test against your polygon to check if your point is in or out of the polygon

Also look for this thread to #6 where there is code to have a loop implement Region (= a real shape cover)

@dsymonds
Copy link
Contributor

I'm not sure there's anything specific to do here. The golang-nuts mailing list can sometimes provide some suitable support, but there isn't a support channel specific for this package.

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

4 participants