Changeset 2903


Ignore:
Timestamp:
May 18, 2006, 10:19:51 AM (19 years ago)
Author:
sexton
Message:

check interior_regions fall in bounding_polygon - tells you which is the offending polygon (not the point)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • production/pt_hedland_2006/run_pt_hedland.py

    r2902 r2903  
    125125
    126126print 'number of interior regions', len(interior_regions)
     127
     128from utilities.polygon import inside_polygon
     129
     130bounding_polygon = project.polyAll
     131count = 0
     132for i in range(len(interior_regions)):
     133    region = interior_regions[i]
     134    interior_polygon = region[0]
     135    if len(inside_polygon(interior_polygon, bounding_polygon,
     136                   closed = True, verbose = False)) <> len(interior_polygon):
     137        print 'WARNING: interior polygon %d is outside bounding polygon' %(i)
     138        count += 1
     139
     140if count == 0:
     141    print 'interior regions OK'
     142else:
     143    print 'check out your interior polygons'
     144    import sys; sys.exit()
     145   
    127146
    128147from caching import cache
Note: See TracChangeset for help on using the changeset viewer.