Skip to content

Commit

Permalink
Allow holes in extent masks
Browse files Browse the repository at this point in the history
  • Loading branch information
oscarpilote committed Feb 15, 2019
1 parent e55aaed commit 146b0c6
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/O4_Mask_Utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -426,7 +426,9 @@ def triangulation_to_image(name,pixel_size,grid_size_or_bbox):
f_ele = open(name+'.1.ele','r')
nbr_tri=int(f_ele.readline().split()[0])
for i in range(nbr_tri):
(n1,n2,n3)=[int(x)-1 for x in f_ele.readline().split()[1:4]]
(n1,n2,n3,tritype)=[int(x)-1 for x in f_ele.readline().split()[1:5]]
tritype+=1
if not tritype: continue
(x1,y1)=vertices[2*n1:2*n1+2]
(x2,y2)=vertices[2*n2:2*n2+2]
(x3,y3)=vertices[2*n3:2*n3+2]
Expand Down Expand Up @@ -516,7 +518,7 @@ def triangulation_to_image(name,pixel_size,grid_size_or_bbox):
reprojection = lambda x, y: pyproj.transform(s_proj, t_proj, x, y)
multipolygon_area=shapely.ops.transform(reprojection,multipolygon_area)

vector_map.encode_MultiPolygon(multipolygon_area,VECT.dummy_alt,'DUMMY',check=True,cut=False)
vector_map.encode_MultiPolygon(multipolygon_area,VECT.dummy_alt,'WATER',check=True,cut=False)
vector_map.write_node_file(name+'.node')
vector_map.write_poly_file(name+'.poly')
print("Triangulate...")
Expand Down

0 comments on commit 146b0c6

Please sign in to comment.