You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- Tabular-style properties export with [10 character field name length limit](https://en.wikipedia.org/wiki/Shapefile#:~:text=Maximum%20length%20of%20field%20names%20is%2010%20characters)
34
32
- Uses jsZip for ZIP files, but [compression is buggy](https://github.com/Stuk/jszip/issues/53) so it uses STORE instead of DEFLATE.
35
33
36
-
## Minimal Example
34
+
## Example
37
35
38
36
```js
39
37
var shpwrite =require("@mapbox/shp-write");
40
38
41
-
// a GeoJSON bridge for features
42
-
constzipData=shpwrite.zip(
43
-
{
39
+
constgeoJSON= {
44
40
type:"FeatureCollection",
45
41
features: [
46
42
{
@@ -64,16 +60,9 @@ const zipData = shpwrite.zip(
64
60
},
65
61
},
66
62
],
67
-
}
68
-
);
69
-
70
-
```
71
-
72
-
## Options Example
73
-
74
-
```js
75
-
var shpwrite =require("@mapbox/shp-write");
63
+
};
76
64
65
+
// Optional custom options passed to the underlying `zip` call
Generate a ArrayBuffer of a zipped shapefile, dbf, and prj, from a GeoJSON
147
117
object.
148
118
149
-
### DEPRECTEAD! May be removed in a future version
150
119
### `download(geojson, [options])`
151
120
152
-
Given a [GeoJSON](http://geojson.org/) FeatureCollection as an object,
153
-
converts convertible features into Shapefiles and triggers a download.
154
-
155
-
The additional `options` parameter is passed to the underlying `zip` call.
156
-
157
-
This is now marked as deprecated because it applies to browsers only and the
121
+
> [!WARNING]
122
+
> This is now marked as deprecated because it applies to browsers only and the
158
123
user should instead rely on an external library for this functionality like
159
124
`file-saver` or `downloadjs`
160
125
126
+
Given a [GeoJSON](http://geojson.org/) FeatureCollection as an object, converts convertible features into Shapefiles and triggers a download. `options` is passed to the underlying `zip` call.
127
+
161
128
## Other Implementations
162
129
163
130
-https://code.google.com/p/pyshp/
@@ -169,3 +136,4 @@ user should instead rely on an external library for this functionality like
0 commit comments