Scraper fuer Geodaten der Pendlerstatistik der Arbeitsagentur
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

summarize-pendler.py 1.1KB

1234567891011121314151617181920212223242526
  1. import json
  2. f = open('pendler.json', 'r')
  3. kreise = f.read()
  4. f.close()
  5. geojson = json.loads(kreise)
  6. for f in geojson['features']:
  7. f['properties']['poptotal'] = f['properties']['einpendler']['svb']['anzahl']
  8. f['properties']['popmale'] = f['properties']['einpendler']['svb']['maenner']
  9. f['properties']['popfemale'] = f['properties']['einpendler']['svb']['frauen']
  10. f['properties']['pendintotal'] = f['properties']['einpendler']['gesamt']['anzahl']
  11. f['properties']['pendinmale'] = f['properties']['einpendler']['gesamt']['maenner']
  12. f['properties']['pendinfemale'] = f['properties']['einpendler']['gesamt']['frauen']
  13. f['properties']['pendouttotal'] = f['properties']['auspendler']['gesamt']['anzahl']
  14. f['properties']['pendoutmale'] = f['properties']['auspendler']['gesamt']['maenner']
  15. f['properties']['pendoutfemale'] = f['properties']['auspendler']['gesamt']['frauen']
  16. f['properties'].pop('einpendler', None)
  17. f['properties'].pop('auspendler', None)
  18. f = open('pendler-summary.json', 'w')
  19. f.write(json.dumps(geojson))
  20. f.close()