Skip to content

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

Description

@gereonkant

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]]]}

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions