File tree Expand file tree Collapse file tree 3 files changed +10
-18
lines changed
Expand file tree Collapse file tree 3 files changed +10
-18
lines changed Original file line number Diff line number Diff line change @@ -10,11 +10,9 @@ class HamburgSpider(SchoolSpider):
1010
1111 start_urls = [
1212 "https://api.hamburg.de/datasets/v1/schulen/collections/staatliche_schulen/items"
13- "?crs=http://www.opengis.net/def/crs/EPSG/0/4326"
14- "&limit=1000" ,
13+ "?limit=1000" ,
1514 "https://api.hamburg.de/datasets/v1/schulen/collections/nicht_staatliche_schulen/items"
16- "?crs=http://www.opengis.net/def/crs/EPSG/0/4326"
17- "&limit=1000"
15+ "?limit=1000"
1816 ]
1917
2018 custom_settings = {
@@ -24,7 +22,7 @@ class HamburgSpider(SchoolSpider):
2422 }
2523
2624 def parse (self , response , ** kwargs ):
27- yield from parse_geojson_features (response , invert = True )
25+ yield from parse_geojson_features (response )
2826
2927 @staticmethod
3028 def normalize (item : Item ) -> School :
Original file line number Diff line number Diff line change 33from scrapy .http import Response
44
55
6- def parse_geojson_features (response : Response , invert : bool = False ):
6+ def parse_geojson_features (response : Response ):
77 geojson = json .loads (response .text )
88
99 for feature in geojson .get ("features" , []):
1010 properties = feature .get ("properties" , {})
1111 coords = feature .get ("geometry" , {}).get ("coordinates" , [])
1212
13- if not invert :
14- properties ["lon" ] = coords [0 ]
15- properties ["lat" ] = coords [1 ]
16- else :
17- properties ["lat" ] = coords [0 ]
18- properties ["lon" ] = coords [1 ]
19-
13+ properties ["lon" ] = coords [0 ]
14+ properties ["lat" ] = coords [1 ]
2015
2116 yield properties
Original file line number Diff line number Diff line change @@ -12,16 +12,15 @@ def test_parse(self):
1212 "type": "FeatureCollection",
1313 "numberReturned": 1,
1414 "numberMatched": 453,
15- "timeStamp": "2025-07-13T16:55:57Z",
16- "crs": "http://www.opengis.net/def/crs/EPSG/0/4326",
15+ "timeStamp": "2025-07-14T19:20:02Z",
1716 "features": [
1817 {
1918 "type": "Feature",
2019 "geometry": {
2120 "type": "Point",
2221 "coordinates": [
23- 53.601522503676144 ,
24- 10.047106063058099
22+ 10.047106063058099 ,
23+ 53.601522503676144
2524 ]
2625 },
2726 "properties": {
@@ -62,7 +61,7 @@ def test_parse(self):
6261 "zuegigkeit_kl_5": "7",
6362 "zustaendiges_rebbz": "ReBBZ Winterhude"
6463 },
65- "id": 874864
64+ "id": 875415
6665 }
6766 ],
6867 "links": []
You can’t perform that action at this time.
0 commit comments