
Security News
Axios Supply Chain Attack Reaches OpenAI macOS Signing Pipeline, Forces Certificate Rotation
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.
@skymapglobal/shp-write
Advanced tools
Writes shapefile in pure javascript. Uses dbf for the data component, and jsZIP to generate ZIP file downloads in-browser.
For node.js or browserify
npm install --save shp-write
Or in a browser
https://unpkg.com/shp-write@latest/shpwrite.js
To test the download functionality run npm run make-test and open index.html in browser.
This should start an immediate download of test features defined in indexTest.js.
var shpwrite = require('shp-write');
// (optional) set names for zip file, zipped folder and feature types
var options = {
folder: 'myshapes',
types: {
point: 'mypoints',
polygon: 'mypolygons',
polyline: 'mylines'
}
}
// a GeoJSON bridge for features
shpwrite.download({
type: 'FeatureCollection',
features: [
{
type: 'Feature',
geometry: {
type: 'Point',
coordinates: [0, 0]
},
properties: {
name: 'Foo'
}
},
{
type: 'Feature',
geometry: {
type: 'Point',
coordinates: [0, 10]
},
properties: {
name: 'Bar'
}
}
]
}, options);
// triggers a download of a zip file with shapefiles contained within.
download(geojson)Given a GeoJSON FeatureCollection as an object, converts convertible features into Shapefiles and triggers a download.
write(data, geometrytype, geometries, callback)Given data, an array of objects for each row of data, geometry, the OGC standard
geometry type (like POINT), geometries, a list of geometries as bare coordinate
arrays, generate a shapfile and call the callback with err and an object with
{
shp: DataView(),
shx: DataView(),
dbf: DataView()
}
zip(geojson)Generate a ArrayBuffer of a zipped shapefile, dbf, and prj, from a GeoJSON object.
This branch includes the following PRs of the official repository:
FAQs
Write shapefiles from pure javascript
We found that @skymapglobal/shp-write demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.

Security News
Open source is under attack because of how much value it creates. It has been the foundation of every major software innovation for the last three decades. This is not the time to walk away from it.

Security News
Socket CEO Feross Aboukhadijeh breaks down how North Korea hijacked Axios and what it means for the future of software supply chain security.