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

tatry

v1.0.5

Published

Elevation API server.

Downloads

24

Readme

NPM version Build Status Dependency Status

tatry

Fast and simple Elevation API server.

Install

$ npm --global install tatry

tatry requires dataset to work. Please refer to open-elevation project on how to download and prepare the dataset. tatry only works with regular TIFF files, uncompressed with elevation data kept as Int32 pixels.

You can use gdal_translate to convert your data.

# to decompress TIFF
gdal_translate -co "COMPRESS=none" in.tif out.tif

# to convert data to Int16 per pixel
gdal_translate -ot Int16 -strict in.tif out.tif

You may need to split large (>4GB) files into smaller parts since tatry does not support BigTIFF file format.

Data does not have to cover contiguous area. Where tatry finds a point that is represented by multimple tiles it will attempt to use the highest resolution data. Results are automatically interpolated using bilinear interpolation.

Configuration

The following environment variables can be specified:

  • TATRY_PORT - port on which server listens - defaults to 3080
  • TATRY_DATA_PATH - location of .tif files - defaults to /var/lib/tatry
  • TATRY_WORKERS - number of workers threads - defaults to 2
  • TATRY_CACHE_SIZE - size of the .tif tile cache, the bigger it is the more .tif info will be kept in memory - defaults to 100mb
  • TATRY_BODY_LIMIT - maximum size of JSON body parsed - default to 250kb

tatry will initialize its environment from /etc/default/tatry file

API

V2

GET /api/v2/lookup?lls=lon_1,lat_1|lon_2,lat_2

Looks up elevation for one or more points. Each point is specified as longitude,latitude pair (think x,y). Points are separated with |.

Example:

/api/v2/lookup?lls=-160,30|100,-45

Result is return as JSON and contains a single results property which is an array of { ll, elevation } tuples.

{
  "results": [
    {
      "ll": [ -160, 30 ],
      "elevation": 100
    },
    {
      "ll": [ 100, -45 ],
      "elevation": -3.5
    }
  ]
}

POST /api/v2/lookup

Looks up elevation for one or more points. Parameters are sent in JSON body. lls parameter contains an array of longitude,latitude pairs.

{
  "lls": [
    [ -160, 30 ],
    [ 100, -45 ]
  ]
}

Result is the same as GET request result.

V1

V1 API is compatible with open-elevation API - click for details

Acknowledgments

Big thank you to João Ricardo Lourenço A.K.A @Jorl17 and @Developer66 for their work on open-elevation project.

License

MIT © Damian Krzeminski