Skip to content

Commit 14803f8

Browse files
authored
Merge pull request #52 from jorisvandenbossche/searchsorted
COMPAT: use numpy searchsorted
2 parents 9a4269f + bb6775a commit 14803f8

File tree

3 files changed

+6
-9
lines changed

3 files changed

+6
-9
lines changed

README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ the internet into geospatial raster files. Bounding boxes can be passed in both
2323

2424
* `mercantile`
2525
* `numpy`
26-
* `pandas`
2726
- `matplotlib`
2827
* `pillow`
2928
* `rasterio`

contextily/tile.py

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
import io
77
import os
88
import numpy as np
9-
import pandas as pd
109
import rasterio as rio
1110
from PIL import Image
1211
from rasterio.transform import from_origin
@@ -258,13 +257,13 @@ def bb2wdw(bb, rtr):
258257
((row_start, row_stop), (col_start, col_stop))
259258
'''
260259
rbb = rtr.bounds
261-
xi = pd.Series(np.linspace(rbb.left, rbb.right, rtr.shape[1]))
262-
yi = pd.Series(np.linspace(rbb.bottom, rbb.top, rtr.shape[0]))
260+
xi = np.linspace(rbb.left, rbb.right, rtr.shape[1])
261+
yi = np.linspace(rbb.bottom, rbb.top, rtr.shape[0])
263262

264-
window = ((rtr.shape[0] - yi.searchsorted(bb[3])[0],
265-
rtr.shape[0] - yi.searchsorted(bb[1])[0]),
266-
(xi.searchsorted(bb[0])[0],
267-
xi.searchsorted(bb[2])[0])
263+
window = ((rtr.shape[0] - yi.searchsorted(bb[3]),
264+
rtr.shape[0] - yi.searchsorted(bb[1])),
265+
(xi.searchsorted(bb[0]),
266+
xi.searchsorted(bb[2]))
268267
)
269268
return window
270269

requirements.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
geopy
22
matplotlib
33
mercantile
4-
pandas
54
pillow
65
pytest
76
rasterio

0 commit comments

Comments
 (0)