Commit 07e95055 authored by Anthony's avatar Anthony
Browse files

Patch Spherical Geometry

parent 6a89d8a3
......@@ -163,9 +163,14 @@ class compweights :
#hydrocell = hydrogrid.polylist[isel]
index = hydrogrid.index[isel]
if cell.intersects_poly(hydrocell):
try:
inter = cell.intersection(hydrocell)
numinter = len(inter.polygons)
except:
print("Shperical Geometry error")
numinter = 0
# Another strange behaviour of SphericalHarmonics. There should be an overlap but the intersection polygone is empty.
if len(inter.polygons) > 0 :
if numinter > 0 :
inside = inter.polygons[0]._inside
if hydrocell.contains_point(inside) and cell.contains_point(inside):
area_in[index[0],index[1]] = min(inter.area(), hydrocell.area())*(EarthRadius**2)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment