Skip to content

Commit 3298462

Browse files
committed
Quantization should happen after interpolation
1 parent c629dc4 commit 3298462

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

utils/readboundaries.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@ def get_boundary_lines(bdatfile, resolution):
9393
if lons:
9494
b = np.empty((len(lons),2),np.float32)
9595
b[:,0] = lons; b[:,1] = lats
96+
b = interpolate_long_segments(b, resolution)
9697
if lsd is not None:
9798
b = quantize(b,lsd)
9899
polybounds.append(b)
@@ -102,9 +103,9 @@ def get_boundary_lines(bdatfile, resolution):
102103
lats.append(lat); lons.append(lon)
103104
b = np.empty((len(lons),2),np.float32)
104105
b[:,0] = lons; b[:,1] = lats
106+
b = interpolate_long_segments(b, resolution)
105107
if lsd is not None:
106108
b = quantize(b,lsd)
107-
b = interpolate_long_segments(b, resolution)
108109
polybounds.append(b)
109110
polymeta = []
110111
polybounds2 = []

utils/readboundaries_shp.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,12 +117,13 @@ def get_wdb_boundaries(resolution,level,rivers=False):
117117
poly_id = attdict['id']
118118
b = np.empty((len(lons),2),np.float32)
119119
b[:,0] = lons; b[:,1] = lats
120-
if lsd is not None:
121-
b = quantize(b,lsd)
122120

123121
if not rivers:
124122
b = interpolate_long_segments(b, resolution)
125123

124+
if lsd is not None:
125+
b = quantize(b,lsd)
126+
126127
polymeta.append([-1,-1,south,north,len(b),poly_id])
127128
polybounds.append(b)
128129

0 commit comments

Comments
 (0)