Skip to content

Commit d4f75f5

Browse files
committed
added geojson snippet
1 parent 1125c2d commit d4f75f5

File tree

3 files changed

+9
-8
lines changed

3 files changed

+9
-8
lines changed

geo/geojson.ipynb

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@
131131
},
132132
{
133133
"cell_type": "code",
134-
"execution_count": 7,
134+
"execution_count": 14,
135135
"metadata": {
136136
"collapsed": false
137137
},
@@ -140,36 +140,36 @@
140140
"name": "stdout",
141141
"output_type": "stream",
142142
"text": [
143-
"{\"geometry\": {\"coordinates\": [7.549783000000001, 47.216111], \"type\": \"Point\"}, \"properties\": {}, \"type\": \"Feature\"}\n"
143+
"{\"geometry\": {\"coordinates\": [7.549783000000001, 47.216111], \"type\": \"Point\"}, \"properties\": {\"name\": \"St. Katharinen\"}, \"type\": \"Feature\"}\n"
144144
]
145145
}
146146
],
147147
"source": [
148148
"\n",
149149
"\n",
150150
"values = zip(df['Longitude'], df['Latitude'], df['Remark'])\n",
151-
"points = [geojson.Feature(geometry=geojson.Point(c), properties=) for v in values]\n",
151+
"points = [geojson.Feature(geometry=geojson.Point((v[0], v[1])), properties={'name': v[2]}) for v in values]\n",
152152
"\n",
153153
"print(points[0])"
154154
]
155155
},
156156
{
157157
"cell_type": "code",
158-
"execution_count": 11,
158+
"execution_count": 18,
159159
"metadata": {
160160
"collapsed": false
161161
},
162162
"outputs": [],
163163
"source": [
164164
"\n",
165165
"\n",
166-
"geo_collection = geojson.FeatureCollection(points[:100])\n",
166+
"geo_collection = geojson.FeatureCollection(points)\n",
167167
"\n"
168168
]
169169
},
170170
{
171171
"cell_type": "code",
172-
"execution_count": 12,
172+
"execution_count": 19,
173173
"metadata": {
174174
"collapsed": false
175175
},
@@ -181,7 +181,7 @@
181181
},
182182
{
183183
"cell_type": "code",
184-
"execution_count": 13,
184+
"execution_count": 20,
185185
"metadata": {
186186
"collapsed": false
187187
},

geo/stations.geojson

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

geo/stations_full.geojson

Lines changed: 1 addition & 0 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)