-
Notifications
You must be signed in to change notification settings - Fork 196
Open
Description
When I try to use the package and export the shapefile of multiple linestrings, it automatically combines the linestrings into one single multi-linestring.
const data = {
"type": "FeatureCollection",
"features": [
{
"type": "Feature",
"properties": {"id": 1},
"geometry": {
"coordinates": [
[ 15.732725333712267, 18.51499012275039 ], [ 29.796471779359706, 18.19539060475546 ]
],
"type": "LineString"
}
},
{
"type": "Feature",
"properties": {"id": 2},
"geometry": {
"coordinates": [
[ 16.008079368924513, 13.843031299450175 ], [ 29.25915144646919, 9.310680918508353 ]
],
"type": "LineString"
}
}
]
}
const shpOptions = { outputType: 'blob'};
const blob = await shpwrite.zip( data, shpOptions);The blob above will contain one multi-linestring. However, I expect to have two linestrings.
In the library, I changed the following line
Line 17 in 48a0fe7
| geometries: shpType === 'POLYLINE' ? [oftype.map(justCoords)] : oftype.map(justCoords), |
to
geometries: shpType === 'POLYLINE' ? oftype.map(l => [justCoords(l)]) : oftype.map(justCoords),This solved the issue to me, but not sure how it will do to actual multi-linestrings.
mihaiMoise, gagecarto and berniesf
Metadata
Metadata
Assignees
Labels
No labels