Skip to content

Commit

Permalink
Merge pull request #36 from Amsterdam/chore/only-allow-point-when-imp…
Browse files Browse the repository at this point in the history
…orting-trees

When importing Oak trees we only want to import trees that have a Point geometry
  • Loading branch information
vanbuiten authored Jun 29, 2023
2 parents 4104b60 + 83f4288 commit bf5b8f3
Show file tree
Hide file tree
Showing 3 changed files with 311 additions and 0 deletions.
4 changes: 4 additions & 0 deletions app/signals_gisib/gisib/import_oak_trees.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,10 @@ def start_import(time_delta: timedelta = None, clear_table: bool = False): # no
update_collection_items = []

for feature_json in collections_json['features']:
if feature_json['geometry']['type'] != 'Point':
logger.warning(f'Skipping Feature: geometry type is not a Point ({feature_json["geometry"]["type"]})')
continue

point_4326 = Point(feature_json['geometry']['coordinates'], srid=28992)
point_4326.transform(4326)

Expand Down
Loading

0 comments on commit bf5b8f3

Please sign in to comment.