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

Added support for multipoint features #151

Open
wants to merge 11 commits into
base: main
Choose a base branch
from
Open

Added support for multipoint features #151

wants to merge 11 commits into from

Conversation

super-bock
Copy link

@super-bock super-bock commented Apr 9, 2020

multiToSingles(multiPointFeature) returns a single point feature for each point in the multipoint input feature

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

@mourner mourner left a 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);
}
Copy link
Member

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.

@asheemmamoowala asheemmamoowala changed the base branch from master to main June 19, 2020 17:53
Fixed function multiToSingles
@frodrigo
Copy link

frodrigo commented Mar 6, 2024

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.

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.

3 participants