npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

es6-mapshaper

v0.4.128

Published

A tool for editing vector datasets for mapping and GIS.

Downloads

6

Readme

mapshaper

Introduction

Mapshaper is software for editing Shapefile, GeoJSON, TopoJSON, CSV and several other data formats, written in JavaScript.

The mapshaper command line program supports essential map making tasks like simplifying shapes, editing attribute data, clipping, erasing, dissolving, filtering and more.

The web UI supports interactive simplification, attribute data editing, and running cli commands in a built-in console. Visit the public website at www.mapshaper.org or use the web UI locally via the mapshaper-gui script.

See the project wiki for more documentation on how to use mapshaper.

To suggest improvements, add an issue.

To learn about recent updates, read the changelog.

Command line tool

The mapshaper command line program has been used successfully under Mac OS X, Linux and Windows.

The project wiki has an introduction to using the command line tool that includes many simple examples.

For a detailed reference, see the Command Reference.

Interactive web interface

The web UI works in recent desktop versions of Chrome, Firefox, Safari and Internet Explorer. Safari before v10.1 and IE before v10 are not supported.

The mapshaper distribution includes the script mapshaper-gui, which runs mapshaper's web interface locally. You can also visit mapshaper.org to use mapshaper online.

All processing is done in the browser, so your data stays private, even when using the public website.

Large file support

Web interface

Firefox is able to load Shapefiles and GeoJSON files larger than 1GB. Chrome has improved in recent versions, but is still prone to out-of-memory errors when importing files larger than several hundred megabytes.

Command line interface

When working with very large files, mapshaper may become unresponsive or crash with the message "JavaScript heap out of memory."

One option is to run mapshaper-xl (added in v0.4.63), which allocates more memory than the standard mapshaper program.

Another solution is to run Node directly with the --max-old-space-size option. The following example (Mac or Linux) allocates 8GB of memory:

$ node  --max-old-space-size=8192 `which mapshaper` <mapshaper commands>

Installation

Mapshaper requires Node.js.

With Node installed, you can install the latest release version of mapshaper using npm. Install with the "-g" flag to make the executable scripts available systemwide.

npm install -g mapshaper

To install and run the latest development code from github:

git clone [email protected]:mbloch/mapshaper.git
cd mapshaper
npm install
bin/mapshaper     # run the command line program
bin/mapshaper-gui # use the web UI locally

Building and testing

Run the build script to build both the cli and web UI modules.

Run npm test in the project directory to run mapshaper's tests.

License

This software is licensed under MPL 2.0.

According to Mozilla's FAQ, "The MPL's ‘file-level’ copyleft is designed to encourage contributors to share modifications they make to your code, while still allowing them to combine your code with code under other licenses (open or proprietary) with minimal restrictions."

Acknowledgements

My colleagues at The New York Times, for countless suggestions, bug reports and general helpfulness.

Mark Harrower, for collaborating on the original "MapShaper" program at the University of Wisconsin–Madison.