mirror of
https://github.com/wassname/geopandas.git
synced 2026-09-20 12:50:47 +08:00
15 lines
460 B
Python
15 lines
460 B
Python
from geopandas import read_file, datasets, clip
|
|
from shapely.geometry import box
|
|
|
|
|
|
class Bench:
|
|
def setup(self, *args):
|
|
world = read_file(datasets.get_path("naturalearth_lowres"))
|
|
capitals = read_file(datasets.get_path("naturalearth_cities"))
|
|
self.bounds = [box(*geom.bounds) for geom in world.geometry]
|
|
self.points = capitals
|
|
|
|
def time_clip(self):
|
|
for bound in self.bounds:
|
|
clip(self.points, bound)
|