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 🙏

© 2025 – Pkg Stats / Ryan Hefner

tilequery

v0.7.1

Published

Query remote vector tiles and return point or polygon features.

Downloads

107

Readme

tilequery

Query remote vector tiles and return point features within a bounding box or point buffer. The returned geojson is only as accurate as the data in the tiles, but the less tiles that need queried the faster the response, so the two factors need to be taken into account when utilizing tilequery.

Polygons and lines will be returned if queried but cut at the tile boundaries. The full list of attributes will be returned however.

A pre-built version is available in docs/dist and can be used directly in the browser with the global variable tilequery. For node, simply use const tilequery = require("tilequery").

Example

const tilequery = require("tilequery");

(async function testTilequery() {
  const now = Date.now()
  const features = await tilequery({
    point: [-82.54, 39.11], 
    radius: 1,
    units: 'miles',
    tiles: 'https://reyemtm.github.io/tilequery/tiles/{z}/{x}/{y}.mvt',
    layer: 'test', 
    zoom: 14,
    buffer: true
  });

  console.log("timer:", Date.now() - now, "ms")
  console.log("features found:", features.features.length)
})()

Margins of Error in Vector Tiles

Keep in mind the margin of error per zoom level. The table below shows the margin of error for 40 points queried using tilequery starting at zoom level 4 compared to the original GeoJSON. Tiles were created with geojson-vt using default settings and errors were checked using Turf JS and turf.distance().

| Zoom Level | Error (ft)| |:-:|-:| | 4 | 811.6139 | | 5 | 322.6163 | | 6 | 170.7157 | | 7 | 78.1861| | 8 | 40.4505| | 9 | 18.8305| | 10 | 9.0808 | | 11 | 5.4247 | | 12 | 2.6212 | | 13 | 1.1149 | | 14 | 0.5900 | | 15 | 0.2986 | | 16 | 0.1576 | | 17 | 0.0682 | | 18 | 0.0347 |


Version Notes

  • 0.5.0 - removed requirement of id field
  • 0.4.0 - Help wanted to convert to ES6.
  • 0.3.2 - Replaced turf.buffer() with turf.circle() due to distance errors in turf.buffer()

Related

https://github.com/stevage/QueryRemoteTiles#readme

https://github.com/mapbox/vtquery