Skip to content

Commit f142945

Browse files
author
Nicholas Weir
committed
fixing label geometries
1 parent 88ac60d commit f142945

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

docs/tutorials/pystac-spacenet-tutorial.ipynb

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -312,17 +312,14 @@
312312
" params = {\n",
313313
" 'id': item.id + '-labels',\n",
314314
" 'bbox': item.bbox,\n",
315+
" 'geometry': box(*item.bbox).__geo_interface__,\n",
315316
" 'datetime': item.datetime,\n",
316317
" 'properties': {},\n",
317318
" 'label_description': 'Building labels for scene {}'.format(item.id),\n",
318319
" 'label_type': 'vector',\n",
319320
" 'label_properties': 'partialBuilding'\n",
320321
" }\n",
321322
" \n",
322-
" with open(label_uri) as gj:\n",
323-
" features = json.load(gj)\n",
324-
" geom_collection = GeometryCollection([shape(feature['geometry']) for feature in features['features']])\n",
325-
" params['geometry'] = geom_collection.__geo_interface__\n",
326323
" label_item = LabelItem(**params)\n",
327324
" \n",
328325
" label_item.add_asset(key='label', asset=Asset(href=label_uri, media_type='application/geo+json'))\n",

0 commit comments

Comments
 (0)