1 | from pylab import * |
---|
2 | from geospatial_data import * |
---|
3 | from pmesh.create_mesh import convert_points_from_latlon_to_utm |
---|
4 | from coordinate_transforms.redfearn import degminsec2decimal_degrees |
---|
5 | from os import sep |
---|
6 | from utilities.polygon import inside_polygon |
---|
7 | import project |
---|
8 | from pyvolution.util import plot_polygons |
---|
9 | |
---|
10 | datadir = project.datadir |
---|
11 | ion() |
---|
12 | |
---|
13 | plot_data = True |
---|
14 | plot_with_poly = False |
---|
15 | |
---|
16 | if plot_data == True: |
---|
17 | file1 = datadir+'onslow_onshore_30m_dted.pts' |
---|
18 | file2 = datadir+'onslow_offshore_points.xya' |
---|
19 | |
---|
20 | G1 = Geospatial_data(file_name = file1) |
---|
21 | G2 = Geospatial_data(file_name = file2) |
---|
22 | |
---|
23 | pts1 = G1.get_data_points(absolute = True) |
---|
24 | pts2 = G2.get_data_points(absolute = True) |
---|
25 | |
---|
26 | if plot_with_poly == True: |
---|
27 | figname = 'onslow_data_poly' |
---|
28 | figure(1) |
---|
29 | plot(pts1[:,0],pts1[:,1],'g.', |
---|
30 | pts2[:,0],pts2[:,1],'b.') |
---|
31 | vec = plot_polygons(project.polyAll, |
---|
32 | [project.poly_onslow, project.poly_coast, project.poly_region], |
---|
33 | figname, |
---|
34 | verbose = True) |
---|
35 | axis([]) |
---|
36 | savefig(figname) |
---|
37 | else: |
---|
38 | figure(2) |
---|
39 | plot(pts1[:,0],pts1[:,1],'g.', |
---|
40 | pts2[:,0],pts2[:,1],'b.') |
---|
41 | xlabel('x') |
---|
42 | ylabel('y') |
---|
43 | savefig('onslow_data_extent') |
---|
44 | else: |
---|
45 | |
---|
46 | figure(3) |
---|
47 | figname = 'onslow_polys' |
---|
48 | vec = plot_polygons(project.polyAll, |
---|
49 | [project.poly_onslow, project.poly_coast, project.poly_region], |
---|
50 | figname, |
---|
51 | verbose = True) |
---|
52 | |
---|
53 | close('all') |
---|