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

geo58

v0.1.0

Published

short link geo coordinates library

Downloads

9

Readme

Geo58js

Yet another short-link specification for geo-coordinates.

Sister library of Geo58 (Python).

Key Features

  • uses base-58 encoding
  • can be as short as 8 characters, mostly 9 characters
  • maximum length of 10 characters
  • resolves to about 1.1m accuracy
  • geocoordinates that are close, look similar
  • can include a zoom level of a map (20-5)

Base58 encoding

Base58 encoding uses 58 alphanumerical characters, 49 of the alphabet plus 9 digits. Characters that look similar ('0', 'O', 'I', 'l') are omitted. This allows for manual copying of data with little potential for ambiguity.

8-10 characters short

The encoding is done in the followin schema: [Zoom 4bit][joined [Lat 25bit][Lon 26bit]]

  • Zoom: beeing an optional parameter for a possible viewport (see below).
  • posLat: is the latitude (mapped from [-90,90] to [0, 180]).
  • posLon: is the longitude (mapped from [-180,180] to [0, 360]).

The last 51 bit are 'intervoven' to generate a bit-sequence with least significant bits to the right. This allows the generation of short-strings that are similar to each other if they are close to one another.

Link similarity

The following 3 short-strings, refer to cafes in Heidelberg, which are only ~25m apart:

  • NBiwwcnfq -> { zoom: 19, lat: 49.41054, lon: 8.69964 }
  • NBiwwcnuw -> { zoom: 19, lat: 49.41047, lon: 8.69984 }
  • NBiwwcnZc -> { zoom: 19, lat: 49.41035, lon: 8.69971 }

Zoom level (can be) included

4 bit of the short-string are used to encode the zoom level of a viewport. This can be used to hint at the size of the object that is being referred to. The zoom level is pre-fixed to the bit-sequence. It is also 'inverted' to allow zoom level 20 to be represented as zero and 19 as one. Zoom level 5 would be using 4 bits.

As the zoom level is pre-fixed, zoom level 20 does not 'consume' any bit-bandwidth, resulting in a short-string being as short as possible.