1 function [ perim_struct ] = shape2struct( prefix )
2 %[ perim_struct ] = shape2struct( prefix )
4 % prefix - string, path to directory with shapefiles
6 % perim_struct - structure with perimeter information
9 % put names in sthe struct file as in UT-SLD-HU2S Patch Springs 8-20-2013
12 d=dir([prefix,'*.shp'])
14 if(isempty(d)), error(['No files found for ',prefix]),end
16 % order the files in time
19 date_format = 'yyyymmdd_HHMM';
20 %date_format = 'mm-dd-yyyy_HHMM';
21 %perim times are local, need to convert to UTC
27 date = d{i}(end-21:end-9);
28 %date = d{i}(end-18:end-4);
29 %t(i) = datenum(date,date_format)+zone_shift/24;
30 t(i) = datenum(date,date_format);
37 for i = 1:length(p.file)
38 perim_struct(i) = shaperead(f{i});
39 %perim_struct(i).Lon = perim_struct(i).X
40 %perim_struct(i).Lat = perim_struct(i).Y
43 for i = 1:length(p.file)
44 %perim_struct(i) = shaperead(f{i})
45 perim_struct(i).Lon = perim_struct(i).X;
46 perim_struct(i).Lat = perim_struct(i).Y;
47 perim_struct(i).Name = replace(p.file{i},'_',' ');
48 perim_struct(i).Name = perim_struct(i).Name(1:end-9);
51 % perim_struct.Lon = perim_struct.X
52 % perim_struct.Lat = perim_struct.Y