Open haoliangyu opened 7 years ago
I have the same problem.
If you run a validity check on a shapefile created with shp-write the error is: unknown geometry type 0
POINT geometry type works fine, POLYLINE and POLYGON are not rendered in QGIS.
maybe this fix it: https://github.com/mapbox/shp-write/issues/44#issuecomment-310360267
Thank you very much, indeed that fixed the problem.
since the fix in #44 is related to parsing from JSON, to apply this fix when using the write
function change in https://github.com/mapbox/shp-write/blob/master/example/test_linestring.js#L17
points,
to [points],
Good news: v0.4.2 is now available. Since #44 hopefully resolves this issue I'm hoping this latest change helps as well.
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
I run the
example/test_linestring.js
in the latest (v3.2.0) repo and it works with no error. But the generated shapefile is not rendered correctly at QGIS because the geometry is NULL, though the properties are properly saved.I run the script with Node v7.2.1 and open the shapefile with QGIS 2.16.1 in Ubuntu 16.04.