Giter VIP home page Giter VIP logo

bgr-apis's Introduction

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 ❤️ at the University of Bonn - EMAS Group

bgr-apis's People

Contributors

chrispahm avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

bgr-apis's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.