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

zid-harmonie

v2.2.1

Published

Farm subsidy application files of all German federal states

Downloads

28

Readme

harmonie :seedling:

harmonie is a software package that harmonizes farm subsidy application files of all German federal states. It takes the various xml, gml, shp, and dbf files issued by the federal farm subsidy application softwares, and converts them into WGS84 projected GeoJSON geometries suitable for any web mapping service.

With harmonie, you can outsource parsing of the different direct payment application files, so you can rely on a given input data structure.

Demonstration of the ZID-Harmonie library

harmonie

  • ✅ works in the browser/Node.js
  • ✅ adheres to the agroJSON specification
  • ✅ is open source (MIT license)

Converting the geometries (fields) contained in the application files is supported for all federal states in Germany. For most federal states, additional information as the primary crop cultivated on a field, as well as the fieldblock number (FLIK) are obtained as well.

The following overview table displays the current state of the project:

✅ Federal states fully supported by 'harmonie': Plot geometries, including crop cultivation code and FLIK are obtained.
☑️ Federal states partially supported by 'harmonie': Only plot geometries are obtained.

| Federal state | ISO 3166-2 code | Subsidy application program | Test data available? | Supported by 'harmonie' | ToDos | |:-----------------------|:----------------|:-----------------------------------------------------------------------------------------------------------------------------------------|:---------------------|:------------------------|:-----------------------------------------------| | Brandenburg | DE-BB | WebClient Agrarantrag BB | ✅ | ✅ | - | | Berlin | DE-BE | WebClient Agrarantrag BB | ✅ | ✅ | - | | Baden-Württemberg | DE-BW | FIONA - Flächeninformation und Online-Antrag | ✅ | ✅ | - | | Bayern | DE-BY | iBalis Bayern | ✅ | ✅ | - | | Bremen | DE-HB | ANDI - Agrarförderung Niedersachsen Digital | ⬜️ | ☑️ | Waiting on test data (ANDI NDS) | | Hessen | DE-HE | Antragsmappe der WI-Bank | ✅ | ✅ | - | | Hamburg | DE-HH | ANDI - Agrarförderung Niedersachsen Digital | ⬜️ | ☑️ | Waiting on test data (ANDI NDS) | | Mecklenburg-Vorpommern | DE-MV | WebClient Agrarantrag MV | ✅ | ✅ | - | | Niedersachsen | DE-NI | ANDI - Agrarförderung Niedersachsen Digital | ⬜️ | ☑️ | Waiting on test data (ANDI NDS) | | Nordrhein-Westfalen | DE-NW | ELAN-NRW WebClient | ✅ | ✅ | - | | Rheinland-Pfalz | DE-RP | eAntrag | ✅ | ☑️ | Create property mapping | | Schleswig-Holstein | DE-SH | WebClient Agrarantrag SH | ⬜️ | ☑️ | Waiting on test data (ELSA Schleswig-Holstein) | | Saarland | DE-SL | ASdigital Saarland | ✅ | ✅ | - | | Sachsen | DE-SN | DianaWeb WebClient SN | ⬜️ | ☑️ | Waiting on test data (DIANAweb Sachsen) | | Sachsen-Anhalt | DE-ST | ELAISA WebClient ST | ⬜️ | ☑️ | Waiting on test data (ELAISA Sachsen-Anhalt) | | Thüringen | DE-TH | Verona Thüringen | ✅ | ✅ | - |

Installation

Browser

<script src='https://cdn.jsdelivr.net/npm/[email protected]/dist/harmonie.min.js'></script>

Or grab a release from the relases tab. Loading the minified file via script tag exposes the global function harmonie.

Internet Explorer compatibility: Note that this package makes use of modern ES6 language features which are not compatible with Internet Explorer (also not by polyfilling). In order to support Internet Explorer directly, you may transpile the code (e.g. using @babel). Alternatively, you may use the plugin on the server side, or use our (upcoming) API.

Node.js / build tools

npm install zid-harmonie

The module exports a single function.

const harmonie = require('zid-harmonie')
// or using ES6 import
import harmonie from 'zid-harmonie'

Demonstration

Check out the following Observable notebook demonstrating the use of the library with a minimal user interface.

https://observablehq.com/@chrispahm/harmonizing-common-agricultural-policy-cap-farm-applicat

Usage

The function takes a single argument (object), returning a Promise.

const data = harmonie({
  state: 'DE-NW', // Required. The federal state (ISO 3166-2 code) that issued the ZID/IACS files
  xml: '<?xml version="1.0" encoding="UTF-8"?><nn>...</nn>', // The input data. Please see table below for required input data files for each federal state, and the required encoding.
  gml: '<?xml version="1.0" encoding="UTF-8"?><wfs>...</wfs>'  
}).then(data => {
  console.log(data)
  // data is an array of "part of field" (DE: 'Teilschläge') objects
}).catch(error => {
  // handle errors
})

API

harmonie(query)

Returns an array of objects containing individual parts of fields (German: Teilschläge). Properties adhere to the naming conventions defined by agroJSON

  • query <object>, required
    • state <string, ISO 3166-2> required
    • xml <string, UTF-8> may be required, depending on state
    • gml <string, UTF-8>
    • shp <blob>
    • dbf <blob>
    • prj <string, UTF-8> optional when passing shapefiles

Sample return value:

[{
  id: 'harmonie_runningIndex_FieldBlockNumber', // e.g. 'harmonie_36_DEBBLI0261009129'
  referenceDate: 2020,
  NameOfField: 'Hinterm Hof',
  NumberOfField: 0,
  Area: 1.1,
  FieldBlockNumber: 'DENW...',
  PartOfField: 0,
  SpatialData: {
    // a GeoJSON feature
  },
  Cultivation: {
    PrimaryCrop: {
      CropSpeciesCode: 415,
      Name: 'Wiesen'
    }
  }
}]

The following table displays the required properties for a query depending on the federal state:

| Federal state | ISO 3166-2 code | Required query data | |:-----------------------|:----------------|:---------------------| | Brandenburg | DE-BB | state, xml | | Berlin | DE-BE | state, xml | | Baden-Württemberg | DE-BW | state, xml, shp, dbf | | Bayern | DE-BY | state, xml | | Bremen | DE-HB | state, shp, dbf | | Hessen | DE-HE | state, shp, dbf | | Hamburg | DE-HH | state, shp, dbf | | Mecklenburg-Vorpommern | DE-MV | state, xml | | Niedersachsen | DE-NI | state, shp, dbf | | Nordrhein-Westfalen | DE-NW | state, xml, gml | | Rheinland-Pfalz | DE-RP | state, shp, dbf | | Schleswig-Holstein | DE-SH | state, shp, dbf | | Saarland | DE-SL | state, shp, dbf | | Sachsen | DE-SN | state, shp, dbf | | Sachsen-Anhalt | DE-ST | state, shp, dbf | | Thüringen | DE-TH | state, shp, dbf |

Specifics for certain federal states

DE-HE: Hessen

According to the test data received from Hessen, the shape file and accompanying database does not contain information about the reference date of the files. Therefore, please expect the referenceDate to be undefined for this federal state.

DE-TH: Thüringen

According to the test data received from Thüringen, the shape file and accompanying database does not contain information about the crop cultivation for a particular field. Therefore, expect the Cultivation property to be empty.

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