2525 'NotEqualToFilter' ,
2626 'NotInFilter' ,
2727 'DrivetimeFilter' ,
28+ 'WalktimeFilter' ,
2829 'MileRadiusFilter' ,
2930 'IntersectsFilter' ,
3031 'OverlapsMileRadiusFilter' ,
@@ -166,20 +167,33 @@ def __init__(self,
166167 longitude: float
167168 Center longitude
168169 minutes: int or float
169- Minutes drive from latitude-longitude center
170+ Minutes drive from or to latitude-longitude center
170171 detailed_type: str
171172 One of:
172173 - 'drivetime': use a normal drivetime, which weights results
173174 - 'drivetime_simple': use a drivetime with weights, but using simplified shapes
174175 - 'drivetime_unweighted': return unweighted results (used to get all geographies
175176 intersecting at all with the drive time area)
177+ - 'drivetime_destination': use a normal drivetime, which weights results, but the
178+ location is the destination instead of the start point
179+ - 'drivetime_destination_simple': use a drivetime with weights, but using simplified
180+ shapes, and the location as the destination
181+ - 'drivetime_destination_unweighted': return unweighted results (used to get all
182+ geographies intersecting at all with the drive time area), and use the location as
183+ the destination
176184 with_traffic: bool
177185 Use traffic estimates to compute the drive time area?
178186 start_time: str
179187 The departure time for the drivetime, used in concert with "with_traffic" set to True
180188 e.g., "2019-05-25T18:00:00"
181189 """
182- assert detailed_type in {'drivetime' , 'drivetime_simple' , 'drivetime_unweighted' }
190+ assert detailed_type in {
191+ 'drivetime' ,
192+ 'drivetime_simple' ,
193+ 'drivetime_unweighted' ,
194+ 'drivetime_destination' ,
195+ 'drivetime_destination_simple' ,
196+ 'drivetime_destination_unweighted' }
183197 assert isinstance (with_traffic , bool )
184198 assert start_time is None or isinstance (start_time , str )
185199
@@ -194,6 +208,49 @@ def __init__(self,
194208 start_time = start_time ))
195209
196210
211+ class WalktimeFilter (BaseFilter ):
212+ def __init__ (self ,
213+ latitude : float ,
214+ longitude : float ,
215+ minutes : Union [int , float ],
216+ detailed_type : str = 'walktime' ):
217+ """
218+ Filter a query to geographies contained by the walktime area
219+
220+ Parameters
221+ ----------
222+ latitude: float
223+ Center latitude
224+ longitude: float
225+ Center longitude
226+ minutes: int or float
227+ Minutes walk from latitude-longitude center
228+ detailed_type: str
229+ One of:
230+ - 'walktime': use a normal walktime, which weights results
231+ - 'walktime_unweighted': return unweighted results (used to get all geographies
232+ intersecting at all with the walk time area)
233+ - 'walktime_destination': use a normal walktime, which weights results, but the
234+ location is the destination instead of the start point
235+ - 'walktime_destination_unweighted': return unweighted results (used to get all
236+ geographies intersecting at all with the walk time area), and use the location as
237+ the destination
238+ """
239+ assert detailed_type in {
240+ 'walktime' ,
241+ 'walktime_unweighted' ,
242+ 'walktime_destination' ,
243+ 'walktime_destination_unweighted' }
244+
245+ super ().__init__ (
246+ filter_type = detailed_type ,
247+ filter_variable = '' ,
248+ filter_value = dict (
249+ latitude = latitude ,
250+ longitude = longitude ,
251+ minutes = minutes ))
252+
253+
197254class IntersectsFilter (BaseFilter ):
198255 def __init__ (self , var : str , val : dict ):
199256 super ().__init__ (
@@ -240,6 +297,7 @@ def __init__(self,
240297 latitude : float ,
241298 longitude : float ,
242299 minutes : Union [int , float ],
300+ detailed_type : str = 'overlaps_drivetime' ,
243301 with_traffic : bool = False ,
244302 start_time : Optional [str ] = None ):
245303 """
@@ -252,7 +310,9 @@ def __init__(self,
252310 latitude: float
253311 longitude: float
254312 minutes: int or float
255- Minutes drive from latitude-longitude center
313+ Minutes drive from or to the latitude-longitude center
314+ detailed_type: str
315+ One of either "overlaps_drivetime" or "overlaps_drivetime_destination"
256316 with_traffic: bool
257317 Use traffic estimates to compute the drive time area?
258318 start_time: str
@@ -265,9 +325,10 @@ def __init__(self,
265325 assert isinstance (minutes , (int , float ))
266326 assert with_traffic is None or isinstance (with_traffic , bool )
267327 assert start_time is None or isinstance (start_time , str )
328+ assert detailed_type in {'overlaps_drivetime' , 'overlaps_drivetime_destination' }
268329
269330 super ().__init__ (
270- filter_type = 'overlaps_drivetime' ,
331+ filter_type = detailed_type ,
271332 filter_variable = var ,
272333 filter_value = dict (
273334 latitude = latitude ,
@@ -282,7 +343,8 @@ def __init__(self,
282343 var : str ,
283344 latitude : float ,
284345 longitude : float ,
285- minutes : Union [int , float ]):
346+ minutes : Union [int , float ],
347+ detailed_type : str = 'overlaps_walktime' ):
286348 """
287349 Filter a query by geometries overlapping the point's surrounding buffer
288350
@@ -294,14 +356,17 @@ def __init__(self,
294356 longitude: float
295357 minutes: int or float
296358 Minutes walk from latitude-longitude center
359+ detailed_type: str
360+ One of either "overlaps_walktime" or "overlaps_walktime_destination"
297361 """
298362 assert isinstance (var , str )
299363 assert isinstance (latitude , float )
300364 assert isinstance (longitude , float )
301365 assert isinstance (minutes , (int , float ))
366+ assert detailed_type in {'overlaps_walktime' , 'overlaps_walktime_destination' }
302367
303368 super ().__init__ (
304- filter_type = 'overlaps_walktime' ,
369+ filter_type = detailed_type ,
305370 filter_variable = var ,
306371 filter_value = dict (
307372 latitude = latitude ,
0 commit comments