MCPcopy Create free account
hub / github.com/RocketMap/RocketMap / get_stops

Method get_stops

pogom/models.py:346–373  ·  view source on GitHub ↗
(swLat, swLng, neLat, neLng)

Source from the content-addressed store, hash-verified

344
345 @staticmethod
346 def get_stops(swLat, swLng, neLat, neLng):
347 if swLat is None or swLng is None or neLat is None or neLng is None:
348 query = (Pokestop
349 .select()
350 .dicts())
351 else:
352 query = (Pokestop
353 .select()
354 .where((Pokestop.latitude >= swLat) &
355 (Pokestop.longitude >= swLng) &
356 (Pokestop.latitude <= neLat) &
357 (Pokestop.longitude <= neLng))
358 .dicts())
359
360 # Performance: Disable the garbage collector prior to creating a (potentially) large dict with append()
361 gc.disable()
362
363 pokestops = []
364 for p in query:
365 if args.china:
366 p['latitude'], p['longitude'] = \
367 transform_from_wgs_to_gcj(p['latitude'], p['longitude'])
368 pokestops.append(p)
369
370 # Re-enable the GC.
371 gc.enable()
372
373 return pokestops
374
375
376class Gym(BaseModel):

Callers 1

raw_dataMethod · 0.80

Calls 2

appendMethod · 0.80

Tested by

no test coverage detected