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

[BUG] MultiLineString features are consolidated into a single feature #127

Open
gereonkant opened this issue Jul 23, 2024 · 1 comment
Open

Comments

@gereonkant
Copy link

gereonkant commented Jul 23, 2024

If you pass .zip() an array of multilinestring features, the lines are consolidated into a single feature.

For the features below, I would expect a shapefile with two independently selectable features. However, they are unified into a single feature. I haven't seen this same issue when working with points

const features = [
{type:"Feature",geometry:{type:"MultiLineString",coordinates:[[[-118.429159,33.997878],[-118.429407,33.998196]],[[-118.429797,33.998696],[-118.429904,33.998833]],[[-118.428464,33.996969],[-118.428366,33.99686],[-118.42825,33.99675],[-118.428044,33.99658]],[[-118.428464,33.996969],[-118.428583,33.997131],[-118.428833,33.997472]]]}},
{type:"Feature",geometry:{type:"MultiLineString",coordinates:[[[-118.403108,34.01443],[-118.403007,34.014388]]]}}
]


const dataforZip = {
        type: "FeatureCollection",
        features: features,
        options
    }

const zipData = await shpwrite.zip(
    dataforZip,
    options
);

The output geometry from the above is:

{"type":"MultiLineString","coordinates":[[[-118.429159,33.997878],[-118.42940700000001,33.998196]],[[-118.429797,33.99869600000001],[-118.429904,33.998833]],[[-118.42846399999999,33.996969],[-118.42836599999998,33.99686],[-118.42825000000002,33.996750000000006],[-118.42804400000001,33.99658]],[[-118.42846399999999,33.996969],[-118.428583,33.997131],[-118.428833,33.997472]],[[-118.40310800000002,34.01443],[-118.403007,34.014388]]]}

@naveenr-southcrust
Copy link

I am also facing the same issue while converting MultilineString coordinates into shapefile, did you find any solution?

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

No branches or pull requests

2 participants