We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2bbfe09 commit ab25b63Copy full SHA for ab25b63
pygeoapi/provider/ogr.py
@@ -30,6 +30,7 @@
30
#
31
# =================================================================
32
33
+from copy import deepcopy
34
import functools
35
import importlib
36
import logging
@@ -528,6 +529,14 @@ def _ogr_feature_to_json(
528
529
if skip_geometry:
530
json_feature['geometry'] = None
531
532
+ # Drop non-defined properties
533
+ if self.properties:
534
+ props = json_feature['properties']
535
+ dropping_keys = deepcopy(props).keys()
536
+ for item in dropping_keys:
537
+ if item not in self.properties:
538
+ props.pop(item)
539
+
540
try:
541
json_feature['id'] = json_feature['properties'].pop(
542
self.id_field, json_feature['id']
0 commit comments