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

Support for MultiPolygon #1358

Closed
wants to merge 18 commits into from
Closed

Support for MultiPolygon #1358

wants to merge 18 commits into from

Conversation

pawanrawal
Copy link
Contributor

@pawanrawal pawanrawal commented Aug 25, 2017

This change is Reviewable

@pawanrawal pawanrawal changed the title Pawan/multi polygon WIP: Pawan/multi polygon Aug 25, 2017
@pawanrawal pawanrawal changed the title WIP: Pawan/multi polygon WIP: Support for MultiPolygon type Aug 25, 2017
@pawanrawal pawanrawal changed the title WIP: Support for MultiPolygon type WIP: Support for MultiPolygon Aug 25, 2017
@pawanrawal
Copy link
Contributor Author

Review status: 0 of 41 files reviewed at latest revision, 4 unresolved discussions, some commit checks failed.


types/geofilter.go, line 48 at r1 (raw file):

type GeoQueryData struct {
	pt    *s2.Point  // If not nil, the input data was a point
	loops []*s2.Loop // If not nil, the input data was a polygon

Contains, Intersects and Within queries can now take MultiPolygons, so we change loops to be a slice.


types/geofilter.go, line 225 at r1 (raw file):

// a temporary fix.
// TODO(Ashwin): Improve this to make it more accurate.
func WithinPolygon(g1 *s2.Loop, g2 *s2.Loop) bool {

We don't need this as I added a function which checks whether one loop Contains another.


types/s2.go, line 32 at r1 (raw file):

// Make s2.Loop implement s2.Region
type loopRegion struct {

Go s2 library added functions to loop for ContainsCell and IntersectsCell, so we don't need these.


types/s2.go, line 79 at r1 (raw file):

// Contains checks whether loop A contains loop B.
func Contains(a *s2.Loop, b *s2.Loop) bool {

I picked this up from the C++ source code.


Comments from Reviewable

@pawanrawal pawanrawal changed the title WIP: Support for MultiPolygon Support for MultiPolygon Aug 28, 2017
@manishrjain
Copy link
Contributor

:lgtm:


Reviewed 37 of 41 files at r1, 4 of 4 files at r2.
Review status: all files reviewed at latest revision, 6 unresolved discussions.


types/geofilter.go, line 245 at r2 (raw file):

// returns true if the geometry represented by g is within the given loop or cap
func (q GeoQueryData) isWithin(g geom.T) bool {
	x.AssertTruef(q.pt != nil || len(q.loops) > 0 || q.cap != nil, "At least a point, loop or cap should be defined.")

100 chars.


types/geofilter.go, line 305 at r2 (raw file):

			}
			return true
		}

Can add an assert here that it shouldn't reach here.


Comments from Reviewable

@janardhan1993
Copy link
Contributor

:lgtm:


Reviewed 37 of 41 files at r1, 4 of 4 files at r2.
Review status: all files reviewed at latest revision, 6 unresolved discussions.


Comments from Reviewable

@pawanrawal
Copy link
Contributor Author

Merged to master.

@pawanrawal pawanrawal closed this Aug 31, 2017
@pawanrawal pawanrawal deleted the pawan/multi-polygon branch September 18, 2017 06:51
jarifibrahim pushed a commit that referenced this pull request Jun 16, 2020
This commit brings the following changes from badger

c45d966 Fix assert in background compression and encryption. (#1366)
14386ac GC: Consider size of value while rewriting (#1357)
b2267c2 Restore: Account for value size as well (#1358)
b762832 Tests: Do not leave behind state goroutines (#1349)
056d859 Support disabling conflict detection (#1344)
fd89894 Compaction: Expired keys and delete markers are never purged (#1354)
543f353 Fix build on golang tip (#1355)
a7e239e StreamWriter: Close head writer (#1347)
da80eb9 Iterator: Always add key to txn.reads (#1328)
7e19cac Add immudb to the project list (#1341)
079f5ae DefaultOptions: Set KeepL0InMemory to false (#1345)
jarifibrahim pushed a commit that referenced this pull request Jun 17, 2020
This commit brings the following changes from badger
```
c45d966 Fix assert in background compression and encryption. (#1366)
14386ac GC: Consider size of value while rewriting (#1357)
b2267c2 Restore: Account for value size as well (#1358)
b762832 Tests: Do not leave behind state goroutines (#1349)
056d859 Support disabling conflict detection (#1344)
fd89894 Compaction: Expired keys and delete markers are never purged (#1354)
543f353 Fix build on golang tip (#1355)
a7e239e StreamWriter: Close head writer (#1347)
da80eb9 Iterator: Always add key to txn.reads (#1328)
7e19cac Add immudb to the project list (#1341)
079f5ae DefaultOptions: Set KeepL0InMemory to false (#1345)
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants