-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathb_preparaTransectas.m
69 lines (49 loc) · 1.86 KB
/
b_preparaTransectas.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Genera el dominio
clear *; close all; clc;
try init; catch me; cd ..; init; end
%% ------------------------ CARGANDO LOS DATOS ------------------------
load('EnsamblesProfiles.mat');
shapeFisio='C:\Users\freitasl\OneDrive\Documentos\IHCantabria-LUCAS-WS\Bruun_Andalucia\0_DATOS_MDT\LFisio_Cadiz.shp';
pltFlag = 1; % quieres graficar?
xi=207957.09196435384; yi=4053469.148830245;
xf=208269.55667316937; yf=4053416.8478704;
dy=25; %[m]
lenTRS=520; %[m]
%% ------------------------- SEPARANDO PERFILES -------------------------
RefSL=ReferenceSL;
RefSL=RefSL.init(xi,yi,xf,yf);
TRS=Transects2;
TRS=TRS.init(RefSL,dy,lenTRS);
TRS=TRS.addSamples(ENS,0);
TRS=TRS.addFisio(shapeFisio);
%% ------------------------- SEPARANDO PERFILES -------------------------
if pltFlag
fig1 = figure;
plot([RefSL.xi RefSL.xf],[RefSL.yi RefSL.yf],'r-',LineWidth=1.2)
hold on;
plot(TRS.xFisio,TRS.yFisio,'m--')
for i=1:numel(TRS.xin); plot([TRS.xin(i),TRS.xof(i)],...
[TRS.yin(i),TRS.yof(i)],'k-');
end
ax=gca;
ax.YLabel.String = 'Y [UTM]';
ax.XLabel.String = 'X [UTM]';
ax.FontSize=12;
ax.FontWeight='bold';
legend('Ref. Line', 'Línea Fisiográfica','Transectos');
axis equal; grid; grid minor;
end
%% ------------------ GIARDANDO UN SHAPEFILE DEL DOMINIO -----------------
% [ETSG: 3042; ETRS89 / UTM zone 30N (N-E)]
Proj=projcrs(3042);
for i=1:numel(TRS.xin)
XTRS{i}=[TRS.xin(i) TRS.xof(i)];YTRS{i}=[TRS.yin(i) TRS.yof(i)];
end
ShapeRef = mapshape([RefSL.xi RefSL.xf],[RefSL.yi RefSL.yf]);
ShapeTRS = mapshape(XTRS,YTRS);
%% --- GUARDA DATOS ---
shapewrite(ShapeRef,[pathRes 'testRefLine_Cadiz.shp'])
shapewrite(ShapeTRS,[pathRes 'Transectas_Cadiz.shp'])
save([pathRes 'TRS_Muralla.mat'],'TRS')
%% --------------------------END--------------------------