Socket
Socket
Sign inDemoInstall

neighborhood-outlines

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

neighborhood-outlines

Takes GeoJSON data for neighborhood outlines, and formats it so that we can use them on our maps.


Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created

Readme

Source

Introduction

Takes GeoJSON data for neighborhood outlines, and formats it so that we can use them on our maps.

Each main city (Berlin, Leipzig, Potdam) has a folder containing folders for each of the main districts (Bezirke). Inside each of these folders is a single JSON file for each of the neighborhoods (Ortsteile). You can choose to pull in an entire city with all the districts, or import each one as needed. You can also pull in the entire city with all the nieghborhoods, or import each one as needed.

// importing a single Bezirk for a city
import { bezirkLichtenberg } from 'neighborhoods-outlines/berlin';

// importing ALL the Bezirke for a city
import { berlin, leipzig } from 'neighborhood-outlines';
or
import { allBezirks } from 'neighborhood-outlines/berlin;

// importing a selection of Ortsteile for a city
import { moabit, wedding, schoeneberg } from 'neighborhood-outlines/berlin';

// importing ALL the Ortsteile for a city
import { berlinNeighborhoods, leipzigNeighborhoods } from 'neighborhood-outlines';
or
import { allNeighborhoods } from 'neighborhood-outlines/berlin;

Example Usage

import { berlin } from 'neighborhood-outlines';

inside of GoogleMapReact onGoogleApiLoaded handler:

const gMap = map.map_;
const shapes = berlin.reduce((results, nextNeighborhood) => {
  if (Array.isArray(nextNeighborhood.coordinates[0])) {
    nextNeighborhood.coordinates.forEach((coords) => {
      const shape = new google.maps.Polygon({
        paths: coords,
        strokeColor: '#FF0000',
        strokeOpacity: 0.8,
        strokeWeight: 2,
        fillColor: '#FF0000',
        fillOpacity: 0.35,
        zIndex: 1000,
      });

      results.push(shape);
    });
  } else {
    const shape = new google.maps.Polygon({
      paths: nextNeighborhood.coordinates,
      strokeColor: '#FF0000',
      strokeOpacity: 0.8,
      strokeWeight: 2,
      fillColor: '#FF0000',
      fillOpacity: 0.35,
      zIndex: 1000,
    });

    results.push(shape);
  }
  return results;
}, []);

shapes.forEach(shape => shape.setMap(gMap));

Berlin Outlines are from:

https://data.technologiestiftung-berlin.de/dataset/ortsteile/en

To use them, must follow these guidelines:

Für die Verwendung der Daten gelten folgende Nutzungsbestimmungen: 
http://www.stadtentwicklung.berlin.de/geoinformation/download/nutzIII.pdf - Der Quellenvermerk gemäß §2 lautet "Geoportal Berlin / [Titel des Datensatzes]".

Leipzig Outlines are from:

https://www.leipzig.de/buergerservice-und-verwaltung/unsere-stadt/gebietsgliederung-und-strassennamen/kommunale-gebietsgliederung/#c22822

To use them, must follow these guidelines:

Für diese Datensätze gilt die "Datenlizenz Deutschland" in der aktuellen Fassung sowie die Nutzungsbedingungen des Open Data-Portals der Stadt Leipzig.
Bei Quellenangabe zitieren Sie bitte wie folgt: "Stadt Leipzig, Amt für Statistik und Wahlen, [Jahr]".

Potsdam Outlines are from:

https://opendata.potsdam.de/explore/dataset/stadtteile/information/?location=10,52.47843,13.13759

FAQs

Package last updated on 12 Jun 2019

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc