@@ -174,7 +174,7 @@ def attribute_detail(token, attribute_id):
174174 _propagate_error (response )
175175
176176
177- def features (token , latitude , longitude , attribute_id , index_by = "id" ):
177+ def features (token , latitude , longitude , attribute_id , index_by = "id" , grid_size = 25 ):
178178 """
179179 An API Endpoint that will return the attributes for provided
180180 coordinates. The API expects the attribute IDs, that can be fetched using
@@ -197,6 +197,10 @@ def features(token, latitude, longitude, attribute_id, index_by="id"):
197197 index_by : {"id", "name"}
198198 One of the ``{"id", "name"}`` denoting whether the output should be indexed
199199 using the original attribute ID or its name
200+ grid_size : {25, 75, 225, 675}
201+ Resolution of the UDL grid to be queried. Smaller resolutions are more precise
202+ but may contain gaps, larger resolutions are aggregated and are more likely to
203+ cover entirety of built up area.
200204
201205 Returns
202206 -------
@@ -261,6 +265,7 @@ def features(token, latitude, longitude, attribute_id, index_by="id"):
261265 }
262266 for x in attribute_id
263267 ],
268+ "grid_size" : f"grid{ grid_size } " ,
264269 }
265270
266271 # calling the API
@@ -273,7 +278,6 @@ def features(token, latitude, longitude, attribute_id, index_by="id"):
273278 json = json_data ,
274279 )
275280 if response .status_code == 200 :
276-
277281 dict_raw = response .json ()
278282
279283 if "error" in dict_raw :
@@ -307,6 +311,7 @@ def features(token, latitude, longitude, attribute_id, index_by="id"):
307311 }
308312 for x in attribute_id
309313 ],
314+ "grid_size" : f"grid{ grid_size } " ,
310315 }
311316
312317 response = requests .post (
@@ -319,7 +324,6 @@ def features(token, latitude, longitude, attribute_id, index_by="id"):
319324 )
320325
321326 if response .status_code == 200 :
322-
323327 d = defaultdict (list )
324328 missing = False
325329 for pt in response .json ()["results" ]:
0 commit comments