Last change
on this file since 16852 was 16852, checked in by bdef, 11 years ago |
CHG: Adding an element active mask for the EPL
|
File size:
937 bytes
|
Line | |
---|
1 | function Shp2Exp(expfilename,shapefilename)
|
---|
2 | %SHP2EXP- transform shape file to Argus .exp file
|
---|
3 | %
|
---|
4 | % Usage:
|
---|
5 | % Shp2Exp(expfilename,shapefilename);
|
---|
6 | %
|
---|
7 | % Example:
|
---|
8 | % Shp2Exp('Domain.exp','Domain.shp');
|
---|
9 | %
|
---|
10 | % See also EXPMASTER, EXPDOC
|
---|
11 |
|
---|
12 | if ~exist(shapefilename,'file'),
|
---|
13 | error(['Shapefile ' shapefilename ' does not exist']);
|
---|
14 | end
|
---|
15 | shp=shaperead(shapefilename);
|
---|
16 |
|
---|
17 | exp=struct([]);
|
---|
18 | for i=1:length(shp),
|
---|
19 | if strcmpi(shp(i).Geometry,'Polygon'),
|
---|
20 | x=shp(i).X; y=shp(i).Y;
|
---|
21 | ids=find(isnan(x));
|
---|
22 | x(ids)=[]; y(ids)=[];
|
---|
23 |
|
---|
24 | exp(end+1).x=x;
|
---|
25 | exp(end).y=y;
|
---|
26 | exp(end).nods=length(x);
|
---|
27 | exp(end).density=1;
|
---|
28 | exp(end).closed=1;
|
---|
29 | exp(end).name=num2str(shp(i).id);
|
---|
30 | elseif strcmpi(shp(i).Geometry,'Point'),
|
---|
31 | x=shp(i).X; y=shp(i).Y;
|
---|
32 |
|
---|
33 | exp(end+1).x=x;
|
---|
34 | exp(end).y=y;
|
---|
35 | exp(end).nods=length(x);
|
---|
36 | exp(end).density=1;
|
---|
37 | exp(end).closed=1;
|
---|
38 | %exp(end).name=num2str(shp(i).id);
|
---|
39 | end
|
---|
40 | end
|
---|
41 |
|
---|
42 | expwrite(exp,expfilename);
|
---|
Note:
See
TracBrowser
for help on using the repository browser.