File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1111COMMON_DEFINITIONS = {}
1212
1313
14+ MDS_FEATURE_POINT = "MDS_Feature_Point"
15+
16+
1417def load_json (path ):
1518 """
1619 Load a JSON file from disk.
@@ -132,14 +135,12 @@ def mds_feature_point_definition():
132135 """
133136 Create a customized definition of the GeoJSON Feature schema for MDS Points.
134137 """
135- name = "MDS_Feature_Point"
136-
137138 # Get the canonical Feature schema
138139 feature = requests .get ("http://geojson.org/schema/Feature.json" ).json ()
139140
140141 # Modify metadata
141142 feature .pop ("$schema" )
142- feature ["$id" ] = definition_id (name )
143+ feature ["$id" ] = definition_id (MDS_FEATURE_POINT )
143144 feature ["title" ] = "MDS GeoJSON Feature Point"
144145
145146 # Only allow GeoJSON Point feature geometry
@@ -163,7 +164,7 @@ def mds_feature_point_definition():
163164 }
164165 }
165166
166- return {name : feature }
167+ return {MDS_FEATURE_POINT : feature }
167168
168169
169170def stop_definitions ():
@@ -177,9 +178,9 @@ def stop_definitions():
177178 "timestamp" ,
178179 "uuid" ,
179180 "uuid_array" ,
180- "vehicle_type_counts"
181+ "vehicle_type_counts" ,
182+ MDS_FEATURE_POINT
181183 )
182- definitions .update (mds_feature_point_definition ())
183184
184185 return definitions
185186
Original file line number Diff line number Diff line change @@ -48,10 +48,10 @@ def endpoint_schema(endpoint, extra_definitions={}):
4848 "string" ,
4949 "timestamp" ,
5050 "uuid" ,
51- "version"
51+ "version" ,
52+ common .MDS_FEATURE_POINT
5253 )
5354 definitions .update (common .point_definition ())
54- definitions .update (common .mds_feature_point_definition ())
5555 definitions .update (extra_definitions )
5656
5757 endpoint_schema = common .load_json (f"./templates/provider/{ endpoint } .json" )
You can’t perform that action at this time.
0 commit comments