Skip to content

identify cleavage segmentation#68

Open
haoxusci wants to merge 2 commits intoimjoy-team:masterfrom
haoxusci:fix-cleavage-id
Open

identify cleavage segmentation#68
haoxusci wants to merge 2 commits intoimjoy-team:masterfrom
haoxusci:fix-cleavage-id

Conversation

@haoxusci
Copy link
Copy Markdown

  • assign unique ids to cleaved circles

@netlify
Copy link
Copy Markdown

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/

}
}

properties['id'] = new Date().getTime()
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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