{"id":19476708,"url":"https://github.com/oklabflensburg/open-social-map","last_synced_at":"2025-02-25T16:24:03.770Z","repository":{"id":186981157,"uuid":"676106696","full_name":"oklabflensburg/open-social-map","owner":"oklabflensburg","description":"Digitaler Sozialatlas als Grundlage für verschiedene Planungsaktivitäten in Flensburg mit den aktuellen und historischen Strukturdaten gegliedert nach Stadtteilen","archived":false,"fork":false,"pushed_at":"2024-12-22T21:49:00.000Z","size":6152,"stargazers_count":2,"open_issues_count":1,"forks_count":2,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-02-24T09:51:58.548Z","etag":null,"topics":["aggregation","data-science","data-visualization","hacktoberfest","opendata","urban-planning"],"latest_commit_sha":null,"homepage":"https://dev.sozialatlas-flensburg.de","language":"HTML","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"cc0-1.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/oklabflensburg.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-08-08T12:53:38.000Z","updated_at":"2024-12-22T21:49:04.000Z","dependencies_parsed_at":"2023-08-08T14:31:26.587Z","dependency_job_id":"a0531992-4046-413c-b874-691d02818e3d","html_url":"https://github.com/oklabflensburg/open-social-map","commit_stats":{"total_commits":205,"total_committers":8,"mean_commits":25.625,"dds":0.2195121951219512,"last_synced_commit":"6e4bff94e8f52b8e61360a39b0f4a5c5314e39d5"},"previous_names":["oklabflensburg/open-social-map"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oklabflensburg%2Fopen-social-map","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oklabflensburg%2Fopen-social-map/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oklabflensburg%2Fopen-social-map/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oklabflensburg%2Fopen-social-map/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/oklabflensburg","download_url":"https://codeload.github.com/oklabflensburg/open-social-map/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240701975,"owners_count":19843816,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["aggregation","data-science","data-visualization","hacktoberfest","opendata","urban-planning"],"created_at":"2024-11-10T19:41:31.023Z","updated_at":"2025-02-25T16:24:03.712Z","avatar_url":"https://github.com/oklabflensburg.png","language":"HTML","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Digitaler Sozialatlas Flensburg\n\n[![Lint javascript](https://github.com/oklabflensburg/open-social-map/actions/workflows/lint-js.yml/badge.svg)](https://github.com/oklabflensburg/open-social-map/actions/workflows/lint-js.yml)\n\n\n![Screenshot Dashboard Sozialatlas](https://raw.githubusercontent.com/oklabflensburg/open-social-map/main/wiki/screenshot_dashboard.jpg)\n\n[Aktueller Entwicklungstand](https://dev.sozialatlas.oklabflensburg.de)\n\n_Haftungsausschluss: Dieses Repository und die zugehörige Datenbank befinden sich derzeit in einer Beta-Version. Einige Aspekte des Codes und der Daten können noch Fehler enthalten. Bitte kontaktieren Sie uns per E-Mail oder erstellen Sie ein Issue auf GitHub, wenn Sie einen Fehler entdecken._\n\n\n## Datenquelle\n\nDer Sozialatlas der Stadt Flensburg wird bereits seit 2010 jährlich veröfentlicht. Dieser beinhaltet unter anderem Auswertungen zu folgenden Bereichen: Bevölkerung, Arbeitsmarkt und Beschäftigung, Wohnen, sozialen Sicherung sowie zu Hilfen zur Erziehung. Der Sozialatlas der Stadt Flensburg wird unter folgendem Link zum [Download](https://www.flensburg.de/Leben-Soziales/Familie-Soziales/Sozialatlas) angeboten. Mit dem Sozialatlas 2022 liegt erstmals die Fortschreibung von Sozialstrukturdaten für die Stadt Flensburg und ihre 13 Stadtteile vor. Die Geodaten der einzelnen Stadtteile wurden freundlicherweise von der Stabsstelle Statistik der Stadt Flensburg zur Verfügung gestellt.\n\n\n## Nutzung\n\nDer digitale Sozialatlas soll eine Grundlage für verschiedene Planungsaktivitäten der Stadt Flensburg und deren Einwohner:innen anbieten. Ziel ist die differenzierte Beobachtung von relevanten Indikatoren, die Aufschluss über die soziale Lage der Stadt und ihrer 13 Stadtteile geben. Bitte dazu auf den Umriss eines Stadtteils klicken, um die jeweiligen Details angezeigt zu bekommen. Dies ist ein erster Prototyp. Wir möchten diesen mit Filtermöglichkeiten ausbauen.\n\n\n## Prerequisites\n\nTo setup the app, make sure to follow the steps to prepare the setup.\n\n```\nsudo apt install wget\nsudo apt install git git-lfs\nsudo apt install python3 python3-pip python3-venv\nsudo sh -c 'echo \"deb http://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main\" \u003e /etc/apt/sources.list.d/pgdg.list'\nwget -qO- https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo tee /etc/apt/trusted.gpg.d/pgdg.asc \u0026\u003e/dev/null\nsudo apt update\nsudo apt install postgresql-16 postgis gdal-bin\n```\n\n\n## Create system user\n\nMake sure to add your user to the `oklab`-group.\n\n```\nsudo adduser oklab\nsudo usermod -a -G www-data oklab\nsudo mkdir -p /opt/oklab\nsudo chown -R oklab:oklab /opt/oklab\nsudo chmod 770 -R /opt/oklab\ncd /opt/oklab/\n```\n\n\n## Prepare database\n\nOpen and edit `/etc/postgresql/16/main/pg_hba.conf` add following two entries into your config.\n\n```\nlocal   oklab           oklab                                   trust\nhost    oklab           oklab           127.0.0.1/32            trust\n```\n\nAfter these edits run `sudo systemctl restart postgresql.service`. To verify everything works run..\n\n```\nsudo systemctl status postgresql.service\n```\n\n\nNow change user `sudo -i -u postgres` and run these commands.\n\n```\ncreateuser -d oklab\ncreatedb -O oklab oklab\npsql -U oklab\nexit\n```\n\nNote since the `oklab`-user does not have superuser permissions you must login with `psql`\n\n```\n\\c oklab\nCREATE EXTENSION IF NOT EXISTS postgis;\nexit\n```\n\n\nMake sure to create a dot `.env` file and add the following enviroment variables. \n\nHint: You may want to change the values accordingly to your setup policy.\n\n```sh\nDB_PASS=postgres\nDB_HOST=localhost\nDB_USER=oklab\nDB_NAME=oklab\nDB_PORT=5432\n```\n\n\n## Setup app\n\nTo use the all open data API endpoints you may import following data\n\n```sh\ncd ..\ngit clone https://github.com/oklabflensburg/open-social-map.git\ncd open-social-map\npsql -U oklab -h localhost -d oklab -p 5432 \u003c data/flensburg_stadtteile.sql\ncd tools\npython3 -m venv venv\nsource venv/bin/activate\npip3 install -r requirements.txt\npython3 insert_districts.py ../static/flensburg_stadtteile.geojson\ndeactivate\npsql -U oklab -h localhost -d oklab -p 5432 \u003c data/flensburg_sozialatlas.sql\npsql -U oklab -h localhost -d oklab -p 5432 \u003c data/flensburg_sozialatlas_meta.sql\n```\n\n\n## Test query\nJetzt könnt ihr in der `PSQL` Umgebung folgende Abfrage ausführen\n\n\n```sql\nSELECT jsonb_build_object(\n    'type', 'FeatureCollection',\n    'crs', json_build_object(\n        'type', 'name',\n        'properties', json_build_object(\n            'name', 'urn:ogc:def:crs:OGC:1.3:CRS84'\n        )\n    ),\n    'features', jsonb_agg(fc.feature)\n) AS geojson\nFROM (\n    SELECT jsonb_build_object(\n        'type', 'Feature',\n        'geometry', ST_AsGeoJSON(d.geometry)::jsonb,\n        'properties', jsonb_build_object('district_id', d.id, 'district_name', d.name)\n    ) AS feature\n    FROM districts AS d\n\n    -- WHERE d.id = 2\n) AS fc;\n```\n\n\n---\n\n\n## How to Contribute\n\nContributions are welcome! Please refer to the [CONTRIBUTING.md](CONTRIBUTING.md) guide for details on how to get involved.\n\n\n---\n\n\n## License\n\nThis repository is licensed under [CC0-1.0](LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foklabflensburg%2Fopen-social-map","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Foklabflensburg%2Fopen-social-map","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foklabflensburg%2Fopen-social-map/lists"}