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

bgr-apis

v0.2.0

Published

Soil quality API covering Germany with data from BGR

Downloads

6

Readme

BGR Soil Information

The Bundesanstalt für Geowissenschaften und Rohstoffe (BGR) provides information on soil quality, types and other factors significant for agricultural use in Germany. As the information is solely available as a mapping service, this repo is aimed at providing a Node-JS client API to the information available.

Installation

Node.js / module bundlers

npm install bgr-apis

Browser

Download the minified file, and include it in a script tag. This will expose a global variable named bgr. This module requires the global variable turf exported from @turf/turf to be available, as well as browser support for the fetch API.

<script src="https://cdn.jsdelivr.net/npm/@turf/turf@5/turf.min.js"></script>
<script src="bgr.min.js" charset="utf-8"></script>

Methods

sqr(point,layer)

bgr.sqr({
  type: 'Point',
  coordinates: [6.9977272,50.778018]
}, 32)
.then(res => {
  // res = 72
})
.catch(err => {
  console.log(err)
})

Returns the soil quality rating (float) at a given point (see Mueller et al. (2007) for infomation on the SQR method).

Point can either be a GeoJSON point, an array of the form [lng, lat] or a GeoJSON feature (e.g. a plot). When a plot (GeoJSON feature) is entered, the centroid of the plot is used.

Optional parameters
layer You can specify another layer if you need information other than the soil quality index (defaults to 32)

| Layer | Description (German) | |:------|:----------------------------------------------| | 32 | Soil Quality Index (default) | | 31 | Bewertung der Bodenarten | | 29 | Bewertung des Humusvorrats | | 27 | Bewertung der Bodenstruktur | | 25 | Bewertung der Packungsdichte | | 23 | Bewertung der effektiven Durchwurzelungstiefe | | 21 | Bewertung des Bodenwasserdargebots | | 19 | Bewertung des mittleren Grundwassertiefstands | | 17 | Bewertung der Hangneigung | | 15 | Bewertung der standörtlichen Bodengüte | | 12 | Bewertung der Versauerungsgefährdung | | 10 | Bewertung der Gründigkeit | | 8 | Bewertung der Trockenheitsgefährdung | | 6 | Bewertung des Steingehaltes im Wurzelraum | | 4 | Ertragslimitierende Faktoren | | 2 | Gefährdungsindikatorwerte |

soilType(point)

bgr.soilType({
  type: 'Point',
  coordinates: [6.9977272,50.778018]
})
.then(res => {
  // res = 'Lehmsande (ls)'
})
.catch(err => {
  // handle errors
})

Returns the soil type (string, UTF-8, german) at a given point.
Possible categories are:

| Soil Types | |:------------------| | Reinsande (ss) | | Lehmsande (ls) | | Schluffsande (us) | | Sandlehme (sl) | | Normallehme (ll) | | Tonlehme (tl) | | Lehmschluffe (lu) | | Tonschluffe (tu) | | Schlufftone (ut) | | Moore (mo) | | Watt | | Siedlung | | Abbauflächen | | Gewässer |

Point can either be a GeoJSON point, an array of the form [lng, lat] or a GeoJSON feature (e.g. a plot). When a plot (GeoJSON feature) is entered, the centroid of the plot is used.

humusContent(point)

bgr.humusContent({
  type: 'Point',
  coordinates: [8.350689,52.087511]
})
.then(res => {
  // res = '2 - <3%'
})
.catch(err => {
  // handle errors
})

Return the humus content (string, UTF-8, german) for a given point. Possible categories are:

| Humus content | |:----------------| | 1 - <2% | | 2 - <3% | | 3 - <4% | | 4 - <6% | | 6 - <8% | | 8 - <11,5% | | 11,5 - <15% | | 15 - <30% | | ≥30% | | Wattflächen | | Gewässerflächen | | Siedlungen | | Abbauflächen | | nicht bestimmt |

Point can either be a GeoJSON point, an array of the form [lng, lat] or a GeoJSON feature (e.g. a plot). When a plot (GeoJSON feature) is entered, the centroid of the plot is used.

Contribution

Contribution is highly appreciated 👍!
Please open an issue in case of questions / bug reports or a pull request if you implemented a new feature / bug fix.
In the latter case, please make sure to run npm test (and adapt test/test.js to your changes) and / or update the README 🙂

License

MIT @Christoph Pahmeyer

This software is crafted with :heart: at the University of Bonn - EMAS Group