Closed antoniocdff closed 10 months ago
As a complement. The resulting shapefile seems to merge all those three features, passed as parameters, then those features are cast to one row.
Change this: https://github.com/mapbox/shp-write/blob/master/src/geojson.js#L7-L12 to:
var oftype = gj.features.filter(isType(type));
var geometries;
if (TYPE === 'POLYGON') {
geometries = [oftype.map(justCoords)];
} else if (TYPE === 'POLYLINE') {
geometries = oftype.map(function(t) { return [justCoords(t)]; });
} else {
geometries = oftype.map(justCoords);
}
return {
geometries: geometries,
properties: oftype.map(justProps),
type: TYPE
};
@ximex Thank you very much sir, that seems to have fixed it.
大神,收下我的膝盖,苦苦调了好久的原因,一直以为是 setInt32 这个方法里面的偏移出现了问题。
This should be resolved now, feel free to test against the latest version (v.0.4.0, not available on npm yet, hopefully soon)
Good news: v0.4.2 is now available.
Less good news: Mapbox changed their deployment organization so this package is now hosted under a different package
@mapbox/shp-write https://unpkg.com/@mapbox/shp-write@latest/shpwrite.js
Hello! I'm trying to generate a shape file from Geojson below but it only generates a result (a geometric feature and a line in the data table). In other cases (polygon and dot) the export normally occurs inside my code.
Here is the snippet of my code: