Skip to content

Commit

Permalink
empty geom with noise in getters
Browse files Browse the repository at this point in the history
  • Loading branch information
wschuell committed Nov 20, 2023
1 parent 0ca2114 commit 0ed5d7b
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions gis_fillers/getters/generic_getters.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,15 @@ def get(self, **kwargs):
if self.add_noise:
tmp = []
for index, poi in gdf.iterrows():
new_point = translate(
gdf.loc[index, "geometry"],
xoff=random.random() * self.noise_size,
yoff=random.random() * self.noise_size,
)
geom = gdf.loc[index, "geometry"]
if geom is None:
new_point = None
else:
new_point = translate(
geom,
xoff=random.random() * self.noise_size,
yoff=random.random() * self.noise_size,
)
tmp.append(
{
"geometry": new_point,
Expand Down

0 comments on commit 0ed5d7b

Please sign in to comment.