Erweiterung der Kreise

This commit is contained in:
Walter Hupfeld 2023-10-06 11:50:50 +02:00
parent e18ee929a6
commit 3a4b59f877
19 changed files with 138 additions and 110 deletions

View File

@ -1,10 +1,30 @@
# unfallkarte # Unfallkarte für Kreise und kreisfreie Städte in NRW
Unfallkarte ## Datenquelle
Darstellung aller Unfälle mit Personenschaden in Nordrhein-Westfalen. Datenquelle ist https://unfallatlas.statistikportal.de, die verwendeten Daten stehen unter einer [Datenlizenz Deutschland - Namensnennung - 2.0](https://www.govdata.de/dl-de/by-2-0)
Bezugsquelle der Geojson-Dateien ## Kreisgrenzen
Quelle für die Kreisgrenzen ist
http://opendatalab.de/projects/geojson-utilities/ http://opendatalab.de/projects/geojson-utilities/
Dort wird die vereinfachte Version exportiert.
## Javascript-Bibliotheken
jQuery
Leaflet
Leaflet Ajax
## Installation
Voraussetzungen ist ein Webserver mit PHP 8.x und eine SQL-Datenbank, z.B. MariaDB.

View File

@ -2,9 +2,6 @@
date_default_timezone_set('UTC'); date_default_timezone_set('UTC');
// $dbFilename = "db/unfallorte";
// $db = new SQLite3($dbFilename);
$db_server = "mariadb"; $db_server = "mariadb";
$db_user = "root"; $db_user = "root";
$db_passwd = "g0r@w@"; $db_passwd = "g0r@w@";
@ -14,104 +11,3 @@ $db = "unfallstatistik";
try { try {
$db = new PDO('mysql:host='.$db_server.';dbname='.$db.';charset=utf8mb4', $db_user, $db_passwd); $db = new PDO('mysql:host='.$db_server.';dbname='.$db.';charset=utf8mb4', $db_user, $db_passwd);
} catch (PDOException $e) {echo "Fehler: ".$e->getMessage(); die();} } catch (PDOException $e) {echo "Fehler: ".$e->getMessage(); die();}
$arrVehicles = array (
1 => "Fahrrad",
2 => "PKW",
3 => "Fussgänger",
4 => "Kraftrad",
5 => "LKW",
6 => "Sonstiges"
);
$arrVehicles_pl = array (
1 => "Fahrrädern",
2 => "PKWs",
3 => "Fussgängern",
4 => "Krafträdern",
5 => "LKWs",
6 => "Sonstigen"
);
$arrWochentage = array (
1 => "Sonntag",
2 => "Montag",
3 => "Dienstag",
4 => "Mittwoch",
5 => "Donnerstag",
6 => "Freitag",
7 => "Samstag"
);
$arrCategory = array (
1 => "Unfall mit Getöteten",
2 => "Unfall mit Schwerverletztem",
3 => "Unfall mit Leichtverletztem",
);
$arrUnfallart = array (
1 => "Zusammenstoß mit anfahrendem/ anhaltendem/ruhendem Fahrzeug",
2 => "Zusammenstoß mit vorausfahrendem / wartendem Fahrzeug",
3 => "Zusammenstoß mit seitlich in gleicher Richtung fahrendem Fahrzeug",
4 => "Zusammenstoß mit entgegenkommendem Fahrzeug",
5 => "Zusammenstoß mit einbiegendem / kreuzendem Fahrzeug",
6 => "Zusammenstoß zwischen Fahrzeug und Fußgänger",
7 => "Aufprall auf Fahrbahnhindernis",
8 => "Abkommen von Fahrbahn nach rechts",
9 => "Abkommen von Fahrbahn nach links",
0 => "Unfall anderer Art",
);
$arrUnfalltyp = array (
1 => "Fahrunfall",
2 => "Abbiegeunfall",
3 => "Einbiegen / Kreuzen-Unfall",
4 => "Überschreiten-Unfall",
5 => "Unfall durch ruhenden Verkehr",
6 => "Unfall im Längsverkehr",
7 => "sonstiger Unfall",
);
$arrLicht = array (
0 => "Tageslicht",
1 => "Dämmerung",
2 => "Dunkelheit",
);
$arrRad = array (
0 => "Unfall ohne Fahrradbeteiligung",
1 => "Unfall mit Fahrradbeteiligung"
);
$arrStrassenzustand = array (
0 => "trocken",
1 => "nass/feucht/schlüpfrig",
2 => "winterglatt",
);
$arrTopic = array (
2 => "Radverkehr",
1 => "Fußverkehr",
3 => "Bus und Bahn",
4 => "Pkw-Verkehr",
5 => "Lkw-Verkehr"
);
$arrMarkerType = array (
0=>"infoMarker",
1=>"pedestrianMarker",
2=>"bicycleMarker",
3=>"trainMarker",
4=>"carMarker",
5=>"truckMarker",
);
$arrIcon = array (
0 => "<i class='wa bg-primary fa fa-info'></i>",
1 => "<i class='wa bg-danger fa fa-male'></i>",
2 => "<i class='wa bg-danger fa fa-bicycle'></i>",
3 => "<i class='wa bg-primary fa fa-bus'></i>",
4 => "<i class='wa bg-danger fa fa-car'></i>",
5 => "<i class='wa bg-warning fa fa-truck'></i>"
);

Binary file not shown.

Before

Width:  |  Height:  |  Size: 41 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.9 KiB

1
geojson/aachen.geojson Normal file

File diff suppressed because one or more lines are too long

1
geojson/bonn.geojson Normal file
View File

@ -0,0 +1 @@
{"type":"FeatureCollection","crs":{"type":"name","properties":{"name":"urn:ogc:def:crs:OGC:1.3:CRS84"}},"source":"© GeoBasis-DE / BKG 2013 (Daten verändert)","features":[{"type":"Feature","properties":{"ADE":6,"GF":4,"BSG":1,"RS":"053140000000","AGS":"05314000","SDV_RS":"053140000000","GEN":"Bonn","BEZ":"Stadt","IBZ":60,"BEM":"kreisfrei","NBD":"ja","SN_L":"05","SN_R":"3","SN_K":"14","SN_V1":"00","SN_V2":"00","SN_G":"000","FK_S3":"R","NUTS":"DEA22","RS_0":"053140000000","AGS_0":"05314000","WSK":"1969/08/01","DEBKG_ID":"DEBKGDL20000E68L","destatis":{"RS":"053140000000","area":141.06,"population":327258,"population_m":156328,"population_w":170930,"population_density":2320,"zip":"53111","center_lon":"7,099187","center_lat":"50,734245","travel_key":"H08","travel_desc":"Bonn und Rhein-Sieg-Kreis","density_key":"01","density_desc":"dicht besiedelt"}},"geometry":{"type":"Polygon","coordinates":[[[7.132213394039788,50.77185443739246],[7.152489927594295,50.76003796337455],[7.155983590259973,50.754678680559444],[7.162994368355575,50.75637051877679],[7.182585677623933,50.751733766369284],[7.194960773577046,50.74376603543042],[7.198575927382817,50.74756380182978],[7.20910622998039,50.73693102717291],[7.191262592081347,50.726594673433645],[7.196577745090615,50.7130563294482],[7.193541439110321,50.710012393850185],[7.174971638244906,50.707700013488015],[7.168237685457546,50.70348964304006],[7.1765638785753,50.68711446963069],[7.210871863698139,50.649543623738644],[7.198485710421079,50.64820873534376],[7.194148580910258,50.6426736488602],[7.18116837749576,50.652288167493076],[7.173445325656328,50.651120430150364],[7.15643069028438,50.65468256281552],[7.128048493072586,50.647264874977225],[7.124027633004187,50.6550737196975],[7.105341569449689,50.65969235994616],[7.076663672841533,50.642760008402774],[7.068919533825222,50.633108920542085],[7.05609828674614,50.631866029833155],[7.060008559766234,50.63888119869577],[7.050659280245579,50.63962725835669],[7.032482040737388,50.65430012421407],[7.026879245740147,50.654951590872],[7.024341991574657,50.66200938123456],[7.027070449016237,50.66560981294732],[7.037746658332092,50.66181177164791],[7.044293391365028,50.67427663298293],[7.031343309555161,50.67783887649247],[7.039260745560407,50.688740242877515],[7.023486323873603,50.70472497390789],[7.028916532785742,50.713147993396],[7.040284265647784,50.71921720534047],[7.0297930349597,50.72607449828582],[7.040359268496386,50.75321392021528],[7.036550905389681,50.757648920032246],[7.048730628272715,50.764227616334246],[7.05652528427954,50.764261395293055],[7.06565827909231,50.77176542618915],[7.098686033671106,50.76161572856992],[7.106758396344291,50.76348274787046],[7.112695173851539,50.771096360584664],[7.125265297984144,50.77443546646668],[7.132213394039788,50.77185443739246]]]}}]}

1
geojson/coesfeld.geojson Normal file

File diff suppressed because one or more lines are too long

1
geojson/hagen.geojson Normal file
View File

@ -0,0 +1 @@
{"type":"FeatureCollection","crs":{"type":"name","properties":{"name":"urn:ogc:def:crs:OGC:1.3:CRS84"}},"source":"© GeoBasis-DE / BKG 2013 (Daten verändert)","features":[{"type":"Feature","properties":{"ADE":6,"GF":4,"BSG":1,"RS":"059140000000","AGS":"05914000","SDV_RS":"059140000000","GEN":"Hagen","BEZ":"Stadt","IBZ":60,"BEM":"kreisfrei","NBD":"ja","SN_L":"05","SN_R":"9","SN_K":"14","SN_V1":"00","SN_V2":"00","SN_G":"000","FK_S3":"R","NUTS":"DEA53","RS_0":"059140000000","AGS_0":"05914000","WSK":"1999/02/01","DEBKG_ID":"DEBKGDL20000E1OI","destatis":{"RS":"059140000000","area":160.45,"population":188814,"population_m":92168,"population_w":96646,"population_density":1177,"zip":"58095","center_lon":"7,467406","center_lat":"51,360171","travel_key":"H11","travel_desc":"Ruhrgebiet","density_key":"01","density_desc":"dicht besiedelt"}},"geometry":{"type":"Polygon","coordinates":[[[7.487180157978995,51.4175713541405],[7.494981538204188,51.415579792683026],[7.50845290761574,51.417941185400174],[7.503289242163876,51.41433649178164],[7.536099101462289,51.406839770129054],[7.531194371111916,51.399413626481866],[7.533588710110251,51.39532321642819],[7.552173040744323,51.39909549824828],[7.566703372640056,51.39854077940354],[7.587816490427026,51.390390414497666],[7.591119030715294,51.38441174857934],[7.584787761770762,51.37779580444411],[7.585948685789316,51.36985134143014],[7.59921540075653,51.346360480917944],[7.593604550633001,51.34414174816323],[7.592891859157715,51.33903687732268],[7.577269302464942,51.33060817276322],[7.584458143631519,51.3196213182544],[7.578517183321369,51.316424104154606],[7.585183801499066,51.30662033601747],[7.583192927430671,51.295865012965216],[7.568924116284109,51.29079092398232],[7.565594470159893,51.281289256960505],[7.550450063143155,51.276008757263625],[7.548881676385763,51.269641234348924],[7.534749304508524,51.27043693186073],[7.517252811795387,51.26486924655582],[7.516854880387277,51.27656487047204],[7.508629353510384,51.2721306301895],[7.498853929563956,51.27316714602382],[7.482015378124063,51.279739054780066],[7.478956825788077,51.28606432023978],[7.486113822213927,51.29513993205325],[7.495644389461222,51.29304027572242],[7.50577880721564,51.3023142099215],[7.503893294291405,51.31586794746874],[7.494522792781022,51.31719871233309],[7.488852789995215,51.313154318418164],[7.482476305029466,51.31661922347857],[7.462273139061231,51.31858289230272],[7.460540934002616,51.31238784829293],[7.454314803818415,51.31745800191746],[7.440118235737004,51.316151941029936],[7.436289862069482,51.30652494591916],[7.427566460235099,51.299894235678536],[7.430051149753901,51.2975280326983],[7.438684149376301,51.2979519183366],[7.433184396385069,51.29490860953218],[7.437831028867999,51.2915542482783],[7.432431688738816,51.28981920150964],[7.429745195405739,51.29457544238171],[7.414470038005143,51.29383213345958],[7.399589221423887,51.30004009086831],[7.400098202524928,51.30229578811203],[7.40942248141175,51.301848601581284],[7.405481752710674,51.30812013329184],[7.418759344371153,51.31087412208424],[7.415110133780876,51.31365972545372],[7.423997685872059,51.31978235313059],[7.421789947571045,51.33088138277895],[7.410074125691876,51.32682733252756],[7.409993514891905,51.3305982462039],[7.398566147151893,51.331665411465124],[7.395236386480828,51.326687646457636],[7.396105863742457,51.332978091318864],[7.390473779146586,51.340384084730026],[7.383738711920587,51.33772001551538],[7.376307999576076,51.34341168172934],[7.378665945627194,51.34998503936672],[7.394195437526633,51.3544762874281],[7.3871034680561,51.357692257752625],[7.395409680409701,51.36035258187323],[7.392631930773249,51.36889674978736],[7.406634813983781,51.379513994175525],[7.402912339506664,51.39333726949466],[7.406274672515681,51.39748701484085],[7.418518643567708,51.40079837712386],[7.435288971330722,51.390438278790725],[7.435963987706289,51.39364429554049],[7.451147581067456,51.39937152196627],[7.454459743387426,51.40891213786608],[7.462752804188664,51.41501567847017],[7.487180157978995,51.4175713541405]]]}}]}

1
geojson/koeln.geojson Normal file
View File

@ -0,0 +1 @@
{"type":"FeatureCollection","crs":{"type":"name","properties":{"name":"urn:ogc:def:crs:OGC:1.3:CRS84"}},"source":"© GeoBasis-DE / BKG 2013 (Daten verändert)","features":[{"type":"Feature","properties":{"ADE":6,"GF":4,"BSG":1,"RS":"053150000000","AGS":"05315000","SDV_RS":"053150000000","GEN":"Köln","BEZ":"Stadt","IBZ":60,"BEM":"kreisfrei","NBD":"ja","SN_L":"05","SN_R":"3","SN_K":"15","SN_V1":"00","SN_V2":"00","SN_G":"000","FK_S3":"R","NUTS":"DEA23","RS_0":"053150000000","AGS_0":"05315000","WSK":"1976/06/01","DEBKG_ID":"DEBKGDL20000E006","destatis":{"RS":"053150000000","area":405.01,"population":1085664,"population_m":529368,"population_w":556296,"population_density":2681,"zip":"50667","center_lon":"6,957068","center_lat":"50,938107","travel_key":"H09","travel_desc":"Köln und Rhein-Erft-Kreis","density_key":"01","density_desc":"dicht besiedelt"}},"geometry":{"type":"Polygon","coordinates":[[[6.914502590301775,51.05635779785663],[6.966668146692467,51.03055783771473],[6.973091503701357,51.02363114805622],[6.975462108880114,51.01091720885419],[6.997063271390999,51.011893171347445],[6.99629006289842,51.0166439457062],[7.013899531622805,51.02307220324898],[7.015867625124374,51.0174113253933],[7.021966505637375,51.01587316223706],[7.041455576515597,51.020885064045515],[7.067905843090977,51.0187399792585],[7.061873789836927,51.01342798540017],[7.076542861278531,51.00178104525814],[7.066570538076888,50.99416499293125],[7.067564800102571,50.9900049716309],[7.095587746219517,50.98520837851833],[7.096175844515996,50.980695022984136],[7.099895601777321,50.98094785442352],[7.096129336701266,50.97710458750757],[7.101279656418287,50.96790104172823],[7.086278178364717,50.95795037459573],[7.115999307009579,50.9413181036291],[7.120300012024967,50.944514539285976],[7.144457342844774,50.946006600549055],[7.136667599367226,50.9277953491645],[7.139926081394659,50.922785024240035],[7.138069637409676,50.90664221575512],[7.133217299170487,50.90218777940359],[7.13835596939718,50.89677893899908],[7.137555728974112,50.883038257537834],[7.152731369957507,50.874588418489765],[7.159623341549616,50.874596215408985],[7.163497358824067,50.86934845893292],[7.090617567689435,50.83327427828334],[7.06235484641336,50.82963003268685],[7.061270096197677,50.8441739821413],[7.057926072815622,50.84912583578063],[7.051048560716534,50.85015568500765],[7.027095184478728,50.84700037000049],[7.023335571814935,50.839256349313175],[7.015523947001136,50.8380210604099],[7.011766927380063,50.83993873404802],[6.995180675086827,50.836253016585275],[6.987075659525692,50.839220199183224],[6.984081152790405,50.84412860281874],[6.980936266864355,50.84091588405724],[6.973903254774891,50.84390110686892],[6.956038056933309,50.83524969940873],[6.94669080166975,50.84551222953603],[6.93809639123518,50.84403266595244],[6.940997998059792,50.83902311984847],[6.931213488941947,50.837497485174445],[6.91726190019596,50.85610188243921],[6.920929346659095,50.871321745669604],[6.912960907859209,50.88289463764232],[6.918886120595273,50.891932526257456],[6.879426193288471,50.909572928221884],[6.867708974726131,50.90435170270643],[6.866173235060526,50.90668192316809],[6.856956248903656,50.90430333648614],[6.844307767624318,50.910058952646736],[6.837948248639353,50.91734490130922],[6.83981112128866,50.92444833154472],[6.822461308560777,50.927729436443094],[6.808810164343487,50.94864764728128],[6.824018731255084,50.95782017051452],[6.818989568213391,50.96526946633883],[6.82929817602789,50.971229861518324],[6.827446640998111,50.974452903893535],[6.845046741311863,50.988492817918285],[6.83524937006978,50.999801912872826],[6.840709591417999,51.00366209000226],[6.845489098185578,51.00316357925185],[6.834954862927487,51.0187671575088],[6.841979844831965,51.02465583975792],[6.820292889561406,51.03800828976222],[6.81280188800033,51.034645482807875],[6.805409755227545,51.03946703490677],[6.798291285476728,51.03695289256185],[6.787832530271252,51.0501172173283],[6.773969786307351,51.05806754034137],[6.773632464385643,51.06439001218816],[6.78736059231218,51.06880985623917],[6.791437185800002,51.06741117662739],[6.800867023188823,51.05945691572737],[6.804759525124521,51.048417292041314],[6.813204041478269,51.04610823528489],[6.816842542901293,51.05378686557239],[6.830983814262506,51.05850394093012],[6.822986484226822,51.073864692523166],[6.838640961862522,51.07793536152142],[6.843085261154439,51.08394830304359],[6.853487489168644,51.084255940345955],[6.859863224970212,51.07407773297486],[6.893596723644555,51.06673012313233],[6.914502590301775,51.05635779785663]]]}}]}

1
geojson/krefeld.geojson Normal file

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

Binary file not shown.

1
geojson/obk.geojson Normal file

File diff suppressed because one or more lines are too long

1
geojson/rbk.geojson Normal file

File diff suppressed because one or more lines are too long

1
geojson/rsk.geojson Normal file

File diff suppressed because one or more lines are too long

1
geojson/viersen.geojson Normal file

File diff suppressed because one or more lines are too long

View File

@ -1,6 +1,7 @@
<?php <?php
require("config.php"); require("config.php");
require_one("lib/attributes.php");
require_once("lib/functions.php"); require_once("lib/functions.php");
$numYear="2022"; $numYear="2022";

View File

@ -1 +0,0 @@
// app.js

101
lib/attributes.php Normal file
View File

@ -0,0 +1,101 @@
<?php
$arrVehicles = array (
1 => "Fahrrad",
2 => "PKW",
3 => "Fussgänger",
4 => "Kraftrad",
5 => "LKW",
6 => "Sonstiges"
);
$arrVehicles_pl = array (
1 => "Fahrrädern",
2 => "PKWs",
3 => "Fussgängern",
4 => "Krafträdern",
5 => "LKWs",
6 => "Sonstigen"
);
$arrWochentage = array (
1 => "Sonntag",
2 => "Montag",
3 => "Dienstag",
4 => "Mittwoch",
5 => "Donnerstag",
6 => "Freitag",
7 => "Samstag"
);
$arrCategory = array (
1 => "Unfall mit Getöteten",
2 => "Unfall mit Schwerverletztem",
3 => "Unfall mit Leichtverletztem",
);
$arrUnfallart = array (
1 => "Zusammenstoß mit anfahrendem/ anhaltendem/ruhendem Fahrzeug",
2 => "Zusammenstoß mit vorausfahrendem / wartendem Fahrzeug",
3 => "Zusammenstoß mit seitlich in gleicher Richtung fahrendem Fahrzeug",
4 => "Zusammenstoß mit entgegenkommendem Fahrzeug",
5 => "Zusammenstoß mit einbiegendem / kreuzendem Fahrzeug",
6 => "Zusammenstoß zwischen Fahrzeug und Fußgänger",
7 => "Aufprall auf Fahrbahnhindernis",
8 => "Abkommen von Fahrbahn nach rechts",
9 => "Abkommen von Fahrbahn nach links",
0 => "Unfall anderer Art",
);
$arrUnfalltyp = array (
1 => "Fahrunfall",
2 => "Abbiegeunfall",
3 => "Einbiegen / Kreuzen-Unfall",
4 => "Überschreiten-Unfall",
5 => "Unfall durch ruhenden Verkehr",
6 => "Unfall im Längsverkehr",
7 => "sonstiger Unfall",
);
$arrLicht = array (
0 => "Tageslicht",
1 => "Dämmerung",
2 => "Dunkelheit",
);
$arrRad = array (
0 => "Unfall ohne Fahrradbeteiligung",
1 => "Unfall mit Fahrradbeteiligung"
);
$arrStrassenzustand = array (
0 => "trocken",
1 => "nass/feucht/schlüpfrig",
2 => "winterglatt",
);
$arrTopic = array (
2 => "Radverkehr",
1 => "Fußverkehr",
3 => "Bus und Bahn",
4 => "Pkw-Verkehr",
5 => "Lkw-Verkehr"
);
$arrMarkerType = array (
0=>"infoMarker",
1=>"pedestrianMarker",
2=>"bicycleMarker",
3=>"trainMarker",
4=>"carMarker",
5=>"truckMarker",
);
$arrIcon = array (
0 => "<i class='wa bg-primary fa fa-info'></i>",
1 => "<i class='wa bg-danger fa fa-male'></i>",
2 => "<i class='wa bg-danger fa fa-bicycle'></i>",
3 => "<i class='wa bg-primary fa fa-bus'></i>",
4 => "<i class='wa bg-danger fa fa-car'></i>",
5 => "<i class='wa bg-warning fa fa-truck'></i>"
);