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

identify cleavage segmentation #68

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

haoxusci
Copy link

  • assign unique ids to cleaved circles

@netlify
Copy link

netlify bot commented Jul 15, 2021

✔️ 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()
Copy link
Collaborator

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?

Copy link
Collaborator

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?

Copy link
Author

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']))
Copy link
Collaborator

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.

Copy link
Author

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
Copy link
Collaborator

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.

Copy link
Author

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.

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