-
Notifications
You must be signed in to change notification settings - Fork 9
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
identify cleavage segmentation #68
base: master
Are you sure you want to change the base?
Conversation
haoxusci
commented
Jul 15, 2021
- assign unique ids to cleaved circles
✔️ Deploy Preview for kaibu ready! 🔨 Explore the source changes: 23dad04 🔍 Inspect the deploy log: https://app.netlify.com/sites/kaibu/deploys/60f154390ca11500083f9810 😎 Browse the preview: https://deploy-preview-68--kaibu.netlify.app/ |
@@ -274,8 +274,14 @@ function polygonCut(polygon, line, properties) { | |||
} | |||
} | |||
|
|||
properties['id'] = new Date().getTime() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What if the ROI already have an id?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Id should be a string, not integer, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
resolved, with using randId() func
cutFeatures.push(turf.polygon(geometry, properties)); | ||
if (Object.keys(properties).includes('id')){ | ||
properties['id'] = properties['id'] + 1 | ||
console.log(JSON.stringify(properties['id'])) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove console message after testing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
removed
cutPolyGeoms.forEach(function(geometry) { | ||
cutFeatures.push(turf.polygon(geometry, properties)); | ||
if (Object.keys(properties).includes('id')){ | ||
properties['id'] = properties['id'] + 1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- +1 doesn't seem to make it unique, maybe better to call 'randId()' to generate a suffix.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
randId() is used to generate the ID.