New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

district-data-germany

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

district-data-germany

geo information about germany's districts

  • 2.0.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
7
increased by133.33%
Maintainers
1
Weekly downloads
 
Created
Source

district-data-germany

WARNING!! MultiPolygon support is still very buggy! Complex results may be wrong!

Functions

Districts.init() [ASYNC]

load the dataset into memory.

Districts.getDistrictData()

Return the complete dataset. This is mostly used interally.

Districts.getDistrictByPoint(lat, lon)

Return the district data that contains the given position or null if the point is not in germany.

Example
const Districts = require('district-data-germany');

const districts = new Districts();
await districts.init();

const district =.districts.getDistrictByPoint(49.4767969145344, 10.9835363685);
console.log(district);

Output:

{
  name_2: 'Fürth',
  name_0: 'Germany',
  name_1: 'Bayern',
  cca_2: '09563',
  engtype_2: 'District',
  geo_point_2d: [ 49.4914188335, 10.9654822077 ],
  hasc_2: 'DE.BY.FL',
  id_2: 77,
  type_2: 'Kreisfreie Stadt',
  id_0: 86,
  id_1: 2,
  iso: 'DEU',
  geo_shape: { type: 'Polygon', coordinates: [ [Array] ] },
  ccn_2: 0
}

License

Software

AGPL-3.0-or-later

Copyright (c) 2020 by Alexander Wunschik dev@wunschik.net

Data

CC BY-NC-SA 4.0 by opendatasoft.com

Keywords

FAQs

Package last updated on 29 Mar 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc