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 = ; const districts = ;await districts; const district =districts;console;
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
Copyright (c) 2020 by Alexander Wunschik dev@wunschik.net
Data
CC BY-NC-SA 4.0 by opendatasoft.com