deutsche-post
German post office postal code utilities. Inofficial, using an endpoint by Deutsche Post. Ask them for permission before using this module in production.
Installation
npm install --save deutsche-post
Usage
const post =
municipalities(postalCode)
to get municipalities (and subsidiary districts) for a given postal codepostalCodeShapes(postalCode)
to get GeoJSON for a given postal codepostalCode(address)
to get the postal code associated with an address (not yet implemented)
municipalities(postalCode)
postalCode
must be a valid german postal code String
like 14050
or 04936
. Returns a Promise
.
post
"postal-code": "04936" "municipality-addition": "" "municipality": "Hillmersdorf" "postal-code": "04936" "municipality-addition": "b Schlieben" "municipality": "Naundorf" "postal-code": "04936" "municipality-addition": "" "municipality": "Proßmarke" // …
or
post
"district": "Charlottenburg" "postal-code": "14057" "municipality": "Berlin" "district": "Westend" "postal-code": "14057" "municipality": "Berlin"
postalCodeShapes(postalCode)
postalCode
must be a valid german postal code, as a number like 10969
or a ECQL query string like strToLowerCase(code) like '109%'
. Returns a Promise
.
post
"type": "FeatureCollection" "totalFeatures": 1 "features": "type": "Feature" "id": "plz_5_2015_q1.10969" "geometry": "type": "MultiPolygon" "coordinates": 13405129 52508324 13405416 52508295 13407717 52506733 // … "geometry_name": "geom" "properties": "code": "10969" "bbox": 13385739 5249588 13415268 52509257 "crs": "type": "name" "properties": "name": "urn:ogc:def:crs:EPSG::4326" "bbox": 5249588 13385739 52509257 13415268
Contributing
If you found a bug, want to propose a feature or feel the urge to complain about your life, feel free to visit the issues page.