Skip to content

hierarchy_fix: prevent superseded parent from replacing self-references in the hierarchy - #22

Merged
missinglink merged 1 commit into
masterfrom
hierarchy_fix
Jul 8, 2020
Merged

hierarchy_fix: prevent superseded parent from replacing self-references in the hierarchy#22
missinglink merged 1 commit into
masterfrom
hierarchy_fix

Conversation

@missinglink

@missinglink missinglink commented Jul 8, 2020

Copy link
Copy Markdown
Member

following on from #21 I caught a fairly uncommon case where a document A has a parent X superseded by Y.
The problem is that if A & Y have the same placetype then the self-reference was being incorrectly replaced.

A = locality
A.hierarchy[0].localadmin_id = X

X (localadmin) is superseded by Y (locality)

A.hierarchy[0].locality_id MUST still equal A, not Y

eg: whosonfirst-data/whosonfirst-data-admin-ca@505cc0e#diff-7e8b7130e6db85a8e6d8fad892353ee8

@missinglink
missinglink merged commit 901931f into master Jul 8, 2020
@missinglink

Copy link
Copy Markdown
Member Author
npm publish
+ @whosonfirst/wof@0.29.0

@orangejulius

Copy link
Copy Markdown
Member

It's funny reading each of your PRs here as you find more and more "interesting" edge cases and uncommon issues. Seems like WOF data is very inherently hard to keep consistent, even though its hierarchy is powerful.

Good to see we are at least chipping away at it with some helpful automation :)

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

Successfully merging this pull request may close these issues.

2 participants