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

mbslice

v1.0.0

Published

Cut a slice of features from MBTiles.

Downloads

3

Readme

Build Status

mbslice

Cut a slice of features from MBTiles.

Filters conform to the Mapbox GL Style Reference.

% mbslice osmqa.mbtiles --filters '["has","highway"]'
{"type":"Feature","geometry":{"type":"LineString","coordinates":[[-117.01981781981885,32.542629002499666],[-117.01971053145826,32.54278953898458],[-117.01983382925391,32.542816742541845],[-117.02062516473234,32.5428822430212]]},"properties":{"_osm_way_id":314010977,"_version":1,"_changeset":26958824,"_uid":2167889,"_user":"Map King","_timestamp":1416684807,"highway":"residential"}}
{"type":"Feature","geometry":{"type":"LineString","coordinates":[[-117.0189228001982,32.54331975956073],[-117.01942085288465,32.54328026162737]]},"properties":{"_osm_way_id":314010978,"_version":1,"_changeset":26958824,"_uid":2167889,"_user":"Map King","_timestamp":1416684807,"name":"Via de la Juventud Oriente","highway":"residential","surface":"paved"}}
{"type":"Feature","geometry":{"type":"LineString","coordinates":[[-117.0189228001982,32.54331975956073],[-117.01889782212675,32.543090332145084],[-117.0189085509628,32.54298173017354],[-117.01894341968,32.54286641550952],[-117.01905330643058,32.542692312697014],[-117.01913855038583,32.542514959241345]]},"properties":{"_osm_way_id":31582583,"_version":21,"_changeset":26958824,"_uid":2167889,"_user":"Map King","_timestamp":1416684810,"name":"Cañón Otay","highway":"residential"}}
% mbslice osmqa.mbtiles --filters '["==","landuse","residential"]'
...

PoC

Baja highways:

✗ node cli.js --quiet --bbox '[-118.13,22.02,-109.03,32.95]' --filters '["has","highway"]' mexico.mbtiles > baja-highways.json
Starting up 4 workers... Job started.
Processing 14910 tiles.
14910 tiles processed in 8s.
✗ tippecanoe -o baja-highways.mbtiles baja-highways.json

For layer 0, using name "bajahighways"
Sorting 98077 features
98077 features, 4650207 bytes of geometry, 3612648 bytes of metadata, 1786436 bytes of string pool
tile 3/1/3 size is 630568 with detail 12, >500000
tile 4/3/6 size is 529065 with detail 12, >500000
tile 5/6/13 size is 694951 with detail 12, >500000
tile 5/6/13 size is 521546 with detail 11, >500000
tile 6/11/25 size is 558106 with detail 12, >500000
tile 6/12/26 size is 593155 with detail 12, >500000
tile 7/22/51 size is 523741 with detail 12, >500000
  100.4%  14/3200/6688
✗ mbview --mbtiles baja-highways.mbtiles
*** Reading from baja-highways.mbtiles
*** Metadata found in the MBTiles
{ scheme: 'tms',
  basename: 'baja-highways.mbtiles',

Works great with tippecanoe and mbview.

demo