Skip to content

Commit e164977

Browse files
authored
Revert "Replace np.in1d by np.isin (#226)" (#227)
This reverts commit e4a1d10.
1 parent e4a1d10 commit e164977

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

topojson/core/dedup.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,9 +132,9 @@ def _find_merged_linestring(self, data, no_ndp_arcs, ndp_arcs, ndp_arcs_bk):
132132
"""
133133

134134
for segment_idx in range(no_ndp_arcs):
135-
# use isin function as proxy for contains
135+
# use in1d function as proxy for contains
136136
merged_arcs_bool = [
137-
np.isin(
137+
np.in1d(
138138
asvoid(data["linestrings"][i]),
139139
asvoid(ndp_arcs.geoms[segment_idx].coords),
140140
).any()

topojson/ops.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -232,9 +232,9 @@ def insert_coords_in_line(line, tree_splitter):
232232
# select junctions having non existing vertices in linestring
233233
tol_float_prc = 1e8
234234
pts_xy_nonexst = pts_xy_on_line[
235-
~np.isin(
236-
asvoid(np.around(pts_xy_on_line * tol_float_prc).astype(np.int64))[:,0],
237-
asvoid(np.around(ls_xy * tol_float_prc).astype(np.int64))[:,0],
235+
~np.in1d(
236+
asvoid(np.around(pts_xy_on_line * tol_float_prc).astype(np.int64)),
237+
asvoid(np.around(ls_xy * tol_float_prc).astype(np.int64)),
238238
)
239239
]
240240
if pts_xy_nonexst.size == 0:
@@ -298,9 +298,9 @@ def fast_split(line, splitter, is_ring):
298298
# locate index of splitter coordinates in linestring
299299
tol = 1e8
300300
splitter_indices = np.flatnonzero(
301-
np.isin(
302-
asvoid(np.around(line * tol).astype(np.int64))[:,0],
303-
asvoid(np.around(splitter * tol).astype(np.int64))[:,0],
301+
np.in1d(
302+
asvoid(np.around(line * tol).astype(np.int64)),
303+
asvoid(np.around(splitter * tol).astype(np.int64)),
304304
)
305305
)
306306

0 commit comments

Comments
 (0)