-
Notifications
You must be signed in to change notification settings - Fork 300
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
Added support for multipoint features #151
base: main
Are you sure you want to change the base?
Conversation
multiToSingles(multiPointFeature) returns a copy of the original multipoint feature for each point in it, replacing values of coordinates and geometry type with the values of the single point geometry
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.
Apologies for a delay in reviewing this — left a comment.
featureTemplate.geometry.coordinates = newCoordinates; | ||
featureTemplate.geometry.type = 'Point'; | ||
newFeatures.push(featureTemplate); | ||
} |
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.
This won't work because JavaScript passes objects by references, so you'll end up with an array of features with exactly the same feature. Additionally, multiPointFeature.properties
is an array so [i]
shouldn't be there.
Fixed function multiToSingles
I have the same need to support MultiPoint. @mourner the last version of this PR is not acceptable for you ? In the opposite case I can make a new PR to fix it. |
multiToSingles(multiPointFeature) returns a single point feature for each point in the multipoint input feature