Skip to content

Commit 38cda73

Browse files
committed
added geojson snippet
1 parent ce07020 commit 38cda73

File tree

2 files changed

+14
-11
lines changed

2 files changed

+14
-11
lines changed

geo/geojson.ipynb

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
},
2424
{
2525
"cell_type": "code",
26-
"execution_count": 65,
26+
"execution_count": 1,
2727
"metadata": {
2828
"collapsed": false
2929
},
@@ -97,7 +97,7 @@
9797
"4 22.0 7.589551 47.547405 277.0 Basel SBB"
9898
]
9999
},
100-
"execution_count": 65,
100+
"execution_count": 1,
101101
"metadata": {},
102102
"output_type": "execute_result"
103103
}
@@ -112,7 +112,7 @@
112112
},
113113
{
114114
"cell_type": "code",
115-
"execution_count": 66,
115+
"execution_count": 2,
116116
"metadata": {
117117
"collapsed": false,
118118
"scrolled": true
@@ -125,12 +125,13 @@
125125
"\n",
126126
"#df[df.isnull().any(axis=1)]\n",
127127
"\n",
128-
"\n"
128+
"\n",
129+
"import geojson as geojson"
129130
]
130131
},
131132
{
132133
"cell_type": "code",
133-
"execution_count": 67,
134+
"execution_count": 3,
134135
"metadata": {
135136
"collapsed": false
136137
},
@@ -144,29 +145,31 @@
144145
}
145146
],
146147
"source": [
148+
"\n",
149+
"\n",
147150
"coordinates = zip(df['Longitude'], df['Latitude'])\n",
148-
"points = [Point(c) for c in coordinates]\n",
151+
"points = [geojson.Point(c) for c in coordinates]\n",
149152
"\n",
150153
"print(points[0])"
151154
]
152155
},
153156
{
154157
"cell_type": "code",
155-
"execution_count": 68,
158+
"execution_count": 4,
156159
"metadata": {
157160
"collapsed": false
158161
},
159162
"outputs": [],
160163
"source": [
161-
"import geojson as geojson\n",
164+
"\n",
162165
"\n",
163166
"geo_collection = geojson.GeometryCollection(points[:100])\n",
164167
"\n"
165168
]
166169
},
167170
{
168171
"cell_type": "code",
169-
"execution_count": 69,
172+
"execution_count": 5,
170173
"metadata": {
171174
"collapsed": false
172175
},
@@ -178,7 +181,7 @@
178181
},
179182
{
180183
"cell_type": "code",
181-
"execution_count": 74,
184+
"execution_count": 6,
182185
"metadata": {
183186
"collapsed": false
184187
},

geo/stations.geojson

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{"geometries": [{"coordinates": [7.549783000000001, 47.216111], "type": "Point"}, {"coordinates": [9.733756, 46.922368], "type": "Point"}, {"coordinates": [7.389462, 47.191804], "type": "Point"}, {"coordinates": [6.513937, 46.659019], "type": "Point"}, {"coordinates": [7.589550999999999, 47.547405], "type": "Point"}, {"coordinates": [7.463717999999999, 46.941186], "type": "Point"}, {"coordinates": [7.395229, 46.937482], "type": "Point"}, {"coordinates": [7.476796, 46.936765], "type": "Point"}, {"coordinates": [7.449205999999999, 46.943903999999996], "type": "Point"}, {"coordinates": [6.838953, 46.949588], "type": "Point"}, {"coordinates": [8.711041, 46.766422999999996], "type": "Point"}, {"coordinates": [9.680469, 47.544340999999996], "type": "Point"}, {"coordinates": [8.500049, 47.114619], "type": "Point"}, {"coordinates": [8.500049, 47.114619], "type": "Point"}, {"coordinates": [8.864358, 47.35788], "type": "Point"}, {"coordinates": [6.956124000000001, 46.917805], "type": "Point"}, {"coordinates": [4.841839, 45.745053999999996], "type": "Point"}, {"coordinates": [7.498003, 46.934922], "type": "Point"}, {"coordinates": [7.498003, 46.934922], "type": "Point"}, {"coordinates": [9.132959, 47.659618], "type": "Point"}, {"coordinates": [5.992531, 46.227068], "type": "Point"}, {"coordinates": [4.893476000000001, 44.927653], "type": "Point"}, {"coordinates": [8.595545, 47.409209000000004], "type": "Point"}, {"coordinates": [8.595545, 47.409209000000004], "type": "Point"}, {"coordinates": [6.989973, 46.619209000000005], "type": "Point"}, {"coordinates": [8.522324000000001, 47.064709], "type": "Point"}, {"coordinates": [8.522324000000001, 47.064709], "type": "Point"}, {"coordinates": [6.927347999999999, 46.993465], "type": "Point"}, {"coordinates": [6.9272350000000005, 46.997036], "type": "Point"}, {"coordinates": [6.108921, 46.204109], "type": "Point"}, {"coordinates": [10.37243, 46.952307], "type": "Point"}, {"coordinates": [8.46411, 47.096531], "type": "Point"}, {"coordinates": [8.931326, 46.724078000000006], "type": "Point"}, {"coordinates": [8.160658, 46.423014], "type": "Point"}, {"coordinates": [9.022001, 47.673211], "type": "Point"}, {"coordinates": [7.304208, 46.113438], "type": "Point"}, {"coordinates": [7.498923, 47.018936], "type": "Point"}, {"coordinates": [8.654442, 46.86457], "type": "Point"}, {"coordinates": [8.742866000000001, 46.669934000000005], "type": "Point"}, {"coordinates": [7.983906, 46.359167], "type": "Point"}, {"coordinates": [8.642729, 47.410319], "type": "Point"}, {"coordinates": [8.642729, 47.410319], "type": "Point"}, {"coordinates": [7.784182, 46.939239], "type": "Point"}, {"coordinates": [9.373785, 47.42495], "type": "Point"}, {"coordinates": [7.5553740000000005, 47.182924], "type": "Point"}, {"coordinates": [8.756199, 47.207308000000005], "type": "Point"}, {"coordinates": [9.145642, 47.769269], "type": "Point"}, {"coordinates": [6.838953, 46.949588], "type": "Point"}, {"coordinates": [7.689360000000001, 47.196374], "type": "Point"}, {"coordinates": [8.603653, 46.154371000000005], "type": "Point"}, {"coordinates": [8.435913000000001, 46.538321999999994], "type": "Point"}, {"coordinates": [7.773846000000001, 46.356888], "type": "Point"}, {"coordinates": [7.7172149999999995, 46.433756], "type": "Point"}, {"coordinates": [8.320797, 47.074529999999996], "type": "Point"}, {"coordinates": [9.985895, 46.806658], "type": "Point"}, {"coordinates": [8.805061, 47.217327000000004], "type": "Point"}, {"coordinates": [8.591156, 46.604329], "type": "Point"}, {"coordinates": [8.64444, 46.652359000000004], "type": "Point"}, {"coordinates": [8.091198, 46.276342], "type": "Point"}, {"coordinates": [8.765599, 46.680772999999995], "type": "Point"}, {"coordinates": [7.904317999999999, 47.401134000000006], "type": "Point"}, {"coordinates": [8.521961, 47.351679], "type": "Point"}, {"coordinates": [7.1062270000000005, 46.816918], "type": "Point"}, {"coordinates": [7.1510229999999995, 46.803268], "type": "Point"}, {"coordinates": [7.8929339999999995, 46.560533], "type": "Point"}, {"coordinates": [7.378475999999999, 46.967959], "type": "Point"}, {"coordinates": [8.681771000000001, 46.022861999999996], "type": "Point"}, {"coordinates": [8.697644, 46.061569], "type": "Point"}, {"coordinates": [8.574167, 45.935159000000006], "type": "Point"}, {"coordinates": [8.552694, 45.928537], "type": "Point"}, {"coordinates": [7.847774, 47.704629], "type": "Point"}, {"coordinates": [7.663838, 47.614431], "type": "Point"}, {"coordinates": [7.691378, 47.624493], "type": "Point"}, {"coordinates": [7.843307000000001, 47.642995], "type": "Point"}, {"coordinates": [7.803227000000001, 47.639485], "type": "Point"}, {"coordinates": [7.762099, 47.637898], "type": "Point"}, {"coordinates": [7.8687059999999995, 47.673435999999995], "type": "Point"}, {"coordinates": [7.695428999999999, 47.637075], "type": "Point"}, {"coordinates": [7.616886999999999, 47.626428999999995], "type": "Point"}, {"coordinates": [7.595277, 47.602965000000005], "type": "Point"}, {"coordinates": [7.6644429999999995, 47.601321999999996], "type": "Point"}, {"coordinates": [7.585033, 47.653453999999996], "type": "Point"}, {"coordinates": [7.556557000000001, 47.5909], "type": "Point"}, {"coordinates": [8.968983, 47.735873], "type": "Point"}, {"coordinates": [11.592709, 48.087034], "type": "Point"}, {"coordinates": [11.592709, 48.087034], "type": "Point"}, {"coordinates": [11.592709, 48.087034], "type": "Point"}, {"coordinates": [11.592709, 48.087034], "type": "Point"}, {"coordinates": [8.560306, 45.755195], "type": "Point"}, {"coordinates": [8.71112, 45.627214], "type": "Point"}, {"coordinates": [8.433672, 46.133272999999996], "type": "Point"}, {"coordinates": [10.507812, 46.87558], "type": "Point"}, {"coordinates": [8.430375999999999, 45.932084], "type": "Point"}, {"coordinates": [8.497996, 46.129224], "type": "Point"}, {"coordinates": [8.41495, 45.970021], "type": "Point"}, {"coordinates": [8.260847, 46.024256], "type": "Point"}, {"coordinates": [8.532187, 45.884881], "type": "Point"}, {"coordinates": [8.218506, 47.620729], "type": "Point"}, {"coordinates": [9.680469, 47.544340999999996], "type": "Point"}, {"coordinates": [9.639062, 47.571899], "type": "Point"}], "type": "GeometryCollection"}
1+
{"geometries": [{"geometry": {"coordinates": [7.549783000000001, 47.216111], "type": "Point"}, "properties": {}, "type": "Feature"}, {"geometry": {"coordinates": [9.733756, 46.922368], "type": "Point"}, "properties": {}, "type": "Feature"}, {"geometry": {"coordinates": [7.389462, 47.191804], "type": "Point"}, "properties": {}, "type": "Feature"}, {"geometry": {"coordinates": [6.513937, 46.659019], "type": "Point"}, "properties": {}, "type": "Feature"}, {"geometry": {"coordinates": [7.589550999999999, 47.547405], "type": "Point"}, "properties": {}, "type": "Feature"}, {"geometry": {"coordinates": [7.463717999999999, 46.941186], "type": "Point"}, "properties": {}, "type": "Feature"}, {"geometry": {"coordinates": [7.395229, 46.937482], "type": "Point"}, "properties": {}, "type": "Feature"}, {"geometry": {"coordinates": [7.476796, 46.936765], "type": "Point"}, "properties": {}, "type": "Feature"}, {"geometry": {"coordinates": [7.449205999999999, 46.943903999999996], "type": "Point"}, "properties": {}, "type": "Feature"}, {"geometry": {"coordinates": [6.838953, 46.949588], "type": "Point"}, "properties": {}, "type": "Feature"}, {"geometry": {"coordinates": [8.711041, 46.766422999999996], "type": "Point"}, "properties": {}, "type": "Feature"}, {"geometry": {"coordinates": [9.680469, 47.544340999999996], "type": "Point"}, "properties": {}, "type": "Feature"}, {"geometry": {"coordinates": [8.500049, 47.114619], "type": "Point"}, "properties": {}, "type": "Feature"}, {"geometry": {"coordinates": [8.500049, 47.114619], "type": "Point"}, "properties": {}, "type": "Feature"}, {"geometry": {"coordinates": [8.864358, 47.35788], "type": "Point"}, "properties": {}, "type": "Feature"}, {"geometry": {"coordinates": [6.956124000000001, 46.917805], "type": "Point"}, "properties": {}, "type": "Feature"}, {"geometry": {"coordinates": [4.841839, 45.745053999999996], "type": "Point"}, "properties": {}, "type": "Feature"}, {"geometry": {"coordinates": [7.498003, 46.934922], "type": "Point"}, "properties": {}, "type": "Feature"}, {"geometry": {"coordinates": [7.498003, 46.934922], "type": "Point"}, "properties": {}, "type": "Feature"}, {"geometry": {"coordinates": [9.132959, 47.659618], "type": "Point"}, "properties": {}, "type": "Feature"}, {"geometry": {"coordinates": [5.992531, 46.227068], "type": "Point"}, "properties": {}, "type": "Feature"}, {"geometry": {"coordinates": [4.893476000000001, 44.927653], "type": "Point"}, "properties": {}, "type": "Feature"}, {"geometry": {"coordinates": [8.595545, 47.409209000000004], "type": "Point"}, "properties": {}, "type": "Feature"}, {"geometry": {"coordinates": [8.595545, 47.409209000000004], "type": "Point"}, "properties": {}, "type": "Feature"}, {"geometry": {"coordinates": [6.989973, 46.619209000000005], "type": "Point"}, "properties": {}, "type": "Feature"}, {"geometry": {"coordinates": [8.522324000000001, 47.064709], "type": "Point"}, "properties": {}, "type": "Feature"}, {"geometry": {"coordinates": [8.522324000000001, 47.064709], "type": "Point"}, "properties": {}, "type": "Feature"}, {"geometry": {"coordinates": [6.927347999999999, 46.993465], "type": "Point"}, "properties": {}, "type": "Feature"}, {"geometry": {"coordinates": [6.9272350000000005, 46.997036], "type": "Point"}, "properties": {}, "type": "Feature"}, {"geometry": {"coordinates": [6.108921, 46.204109], "type": "Point"}, "properties": {}, "type": "Feature"}, {"geometry": {"coordinates": [10.37243, 46.952307], "type": "Point"}, "properties": {}, "type": "Feature"}, {"geometry": {"coordinates": [8.46411, 47.096531], "type": "Point"}, "properties": {}, "type": "Feature"}, {"geometry": {"coordinates": [8.931326, 46.724078000000006], "type": "Point"}, "properties": {}, "type": "Feature"}, {"geometry": {"coordinates": [8.160658, 46.423014], "type": "Point"}, "properties": {}, "type": "Feature"}, {"geometry": {"coordinates": [9.022001, 47.673211], "type": "Point"}, "properties": {}, "type": "Feature"}, {"geometry": {"coordinates": [7.304208, 46.113438], "type": "Point"}, "properties": {}, "type": "Feature"}, {"geometry": {"coordinates": [7.498923, 47.018936], "type": "Point"}, "properties": {}, "type": "Feature"}, {"geometry": {"coordinates": [8.654442, 46.86457], "type": "Point"}, "properties": {}, "type": "Feature"}, {"geometry": {"coordinates": [8.742866000000001, 46.669934000000005], "type": "Point"}, "properties": {}, "type": "Feature"}, {"geometry": {"coordinates": [7.983906, 46.359167], "type": "Point"}, "properties": {}, "type": "Feature"}, {"geometry": {"coordinates": [8.642729, 47.410319], "type": "Point"}, "properties": {}, "type": "Feature"}, {"geometry": {"coordinates": [8.642729, 47.410319], "type": "Point"}, "properties": {}, "type": "Feature"}, {"geometry": {"coordinates": [7.784182, 46.939239], "type": "Point"}, "properties": {}, "type": "Feature"}, {"geometry": {"coordinates": [9.373785, 47.42495], "type": "Point"}, "properties": {}, "type": "Feature"}, {"geometry": {"coordinates": [7.5553740000000005, 47.182924], "type": "Point"}, "properties": {}, "type": "Feature"}, {"geometry": {"coordinates": [8.756199, 47.207308000000005], "type": "Point"}, "properties": {}, "type": "Feature"}, {"geometry": {"coordinates": [9.145642, 47.769269], "type": "Point"}, "properties": {}, "type": "Feature"}, {"geometry": {"coordinates": [6.838953, 46.949588], "type": "Point"}, "properties": {}, "type": "Feature"}, {"geometry": {"coordinates": [7.689360000000001, 47.196374], "type": "Point"}, "properties": {}, "type": "Feature"}, {"geometry": {"coordinates": [8.603653, 46.154371000000005], "type": "Point"}, "properties": {}, "type": "Feature"}, {"geometry": {"coordinates": [8.435913000000001, 46.538321999999994], "type": "Point"}, "properties": {}, "type": "Feature"}, {"geometry": {"coordinates": [7.773846000000001, 46.356888], "type": "Point"}, "properties": {}, "type": "Feature"}, {"geometry": {"coordinates": [7.7172149999999995, 46.433756], "type": "Point"}, "properties": {}, "type": "Feature"}, {"geometry": {"coordinates": [8.320797, 47.074529999999996], "type": "Point"}, "properties": {}, "type": "Feature"}, {"geometry": {"coordinates": [9.985895, 46.806658], "type": "Point"}, "properties": {}, "type": "Feature"}, {"geometry": {"coordinates": [8.805061, 47.217327000000004], "type": "Point"}, "properties": {}, "type": "Feature"}, {"geometry": {"coordinates": [8.591156, 46.604329], "type": "Point"}, "properties": {}, "type": "Feature"}, {"geometry": {"coordinates": [8.64444, 46.652359000000004], "type": "Point"}, "properties": {}, "type": "Feature"}, {"geometry": {"coordinates": [8.091198, 46.276342], "type": "Point"}, "properties": {}, "type": "Feature"}, {"geometry": {"coordinates": [8.765599, 46.680772999999995], "type": "Point"}, "properties": {}, "type": "Feature"}, {"geometry": {"coordinates": [7.904317999999999, 47.401134000000006], "type": "Point"}, "properties": {}, "type": "Feature"}, {"geometry": {"coordinates": [8.521961, 47.351679], "type": "Point"}, "properties": {}, "type": "Feature"}, {"geometry": {"coordinates": [7.1062270000000005, 46.816918], "type": "Point"}, "properties": {}, "type": "Feature"}, {"geometry": {"coordinates": [7.1510229999999995, 46.803268], "type": "Point"}, "properties": {}, "type": "Feature"}, {"geometry": {"coordinates": [7.8929339999999995, 46.560533], "type": "Point"}, "properties": {}, "type": "Feature"}, {"geometry": {"coordinates": [7.378475999999999, 46.967959], "type": "Point"}, "properties": {}, "type": "Feature"}, {"geometry": {"coordinates": [8.681771000000001, 46.022861999999996], "type": "Point"}, "properties": {}, "type": "Feature"}, {"geometry": {"coordinates": [8.697644, 46.061569], "type": "Point"}, "properties": {}, "type": "Feature"}, {"geometry": {"coordinates": [8.574167, 45.935159000000006], "type": "Point"}, "properties": {}, "type": "Feature"}, {"geometry": {"coordinates": [8.552694, 45.928537], "type": "Point"}, "properties": {}, "type": "Feature"}, {"geometry": {"coordinates": [7.847774, 47.704629], "type": "Point"}, "properties": {}, "type": "Feature"}, {"geometry": {"coordinates": [7.663838, 47.614431], "type": "Point"}, "properties": {}, "type": "Feature"}, {"geometry": {"coordinates": [7.691378, 47.624493], "type": "Point"}, "properties": {}, "type": "Feature"}, {"geometry": {"coordinates": [7.843307000000001, 47.642995], "type": "Point"}, "properties": {}, "type": "Feature"}, {"geometry": {"coordinates": [7.803227000000001, 47.639485], "type": "Point"}, "properties": {}, "type": "Feature"}, {"geometry": {"coordinates": [7.762099, 47.637898], "type": "Point"}, "properties": {}, "type": "Feature"}, {"geometry": {"coordinates": [7.8687059999999995, 47.673435999999995], "type": "Point"}, "properties": {}, "type": "Feature"}, {"geometry": {"coordinates": [7.695428999999999, 47.637075], "type": "Point"}, "properties": {}, "type": "Feature"}, {"geometry": {"coordinates": [7.616886999999999, 47.626428999999995], "type": "Point"}, "properties": {}, "type": "Feature"}, {"geometry": {"coordinates": [7.595277, 47.602965000000005], "type": "Point"}, "properties": {}, "type": "Feature"}, {"geometry": {"coordinates": [7.6644429999999995, 47.601321999999996], "type": "Point"}, "properties": {}, "type": "Feature"}, {"geometry": {"coordinates": [7.585033, 47.653453999999996], "type": "Point"}, "properties": {}, "type": "Feature"}, {"geometry": {"coordinates": [7.556557000000001, 47.5909], "type": "Point"}, "properties": {}, "type": "Feature"}, {"geometry": {"coordinates": [8.968983, 47.735873], "type": "Point"}, "properties": {}, "type": "Feature"}, {"geometry": {"coordinates": [11.592709, 48.087034], "type": "Point"}, "properties": {}, "type": "Feature"}, {"geometry": {"coordinates": [11.592709, 48.087034], "type": "Point"}, "properties": {}, "type": "Feature"}, {"geometry": {"coordinates": [11.592709, 48.087034], "type": "Point"}, "properties": {}, "type": "Feature"}, {"geometry": {"coordinates": [11.592709, 48.087034], "type": "Point"}, "properties": {}, "type": "Feature"}, {"geometry": {"coordinates": [8.560306, 45.755195], "type": "Point"}, "properties": {}, "type": "Feature"}, {"geometry": {"coordinates": [8.71112, 45.627214], "type": "Point"}, "properties": {}, "type": "Feature"}, {"geometry": {"coordinates": [8.433672, 46.133272999999996], "type": "Point"}, "properties": {}, "type": "Feature"}, {"geometry": {"coordinates": [10.507812, 46.87558], "type": "Point"}, "properties": {}, "type": "Feature"}, {"geometry": {"coordinates": [8.430375999999999, 45.932084], "type": "Point"}, "properties": {}, "type": "Feature"}, {"geometry": {"coordinates": [8.497996, 46.129224], "type": "Point"}, "properties": {}, "type": "Feature"}, {"geometry": {"coordinates": [8.41495, 45.970021], "type": "Point"}, "properties": {}, "type": "Feature"}, {"geometry": {"coordinates": [8.260847, 46.024256], "type": "Point"}, "properties": {}, "type": "Feature"}, {"geometry": {"coordinates": [8.532187, 45.884881], "type": "Point"}, "properties": {}, "type": "Feature"}, {"geometry": {"coordinates": [8.218506, 47.620729], "type": "Point"}, "properties": {}, "type": "Feature"}, {"geometry": {"coordinates": [9.680469, 47.544340999999996], "type": "Point"}, "properties": {}, "type": "Feature"}, {"geometry": {"coordinates": [9.639062, 47.571899], "type": "Point"}, "properties": {}, "type": "Feature"}], "type": "GeometryCollection"}

0 commit comments

Comments
 (0)