Changeset 21349
- Timestamp:
- 11/07/16 09:58:46 (8 years ago)
- Location:
- issm/trunk-jpl/src
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk-jpl/src/m/shp/shp2exp.m
r17542 r21349 33 33 expstruct(end).nods=length(x); 34 34 expstruct(end).density=1; 35 expstruct(end).closed= 1;35 expstruct(end).closed=0; 36 36 %exp(end).name=num2str(shp(i).id); 37 37 elseif strcmpi(shp(i).Geometry,'Line'), 38 38 x=shp(i).X; y=shp(i).Y; 39 x(end)=x(1); y(end)=y(1);40 39 expstruct(end+1).x=x; 41 40 expstruct(end).y=y; 42 41 expstruct(end).nods=length(x); 43 42 expstruct(end).density=1; 44 expstruct(end).closed= 1;43 expstruct(end).closed=0; 45 44 end 46 45 end -
issm/trunk-jpl/src/m/shp/shp2exp.py
r19423 r21349 26 26 27 27 shp=shapefile.Reader(shapefilename) 28 expdict=dict( closed=1,density=1)28 expdict=dict(density=1) 29 29 30 30 x=[] … … 33 33 geom=shp.shapes()[i].shapeType 34 34 if geom==5: # polygon 35 expdict['closed']=1 35 36 tmpx=[p[0] for p in shp.shapes()[i].points] 36 37 tmpy=[q[1] for q in shp.shapes()[i].points] … … 38 39 y.append(tmpy) 39 40 elif geom==3: # line 41 expdict['closed']=0 40 42 tmpx=[p[0] for p in shp.shapes()[i].points] 41 43 tmpy=[q[1] for q in shp.shapes()[i].points] … … 43 45 y.append(tmpy) 44 46 elif geom==1: # point 47 expdict['closed']=0 45 48 x.append(shp.shapes()[i].points[0][0]) 46 49 y.append(shp.shapes()[i].points[0][1]) -
issm/trunk-jpl/src/py3/shp/shp2exp.py
r19895 r21349 26 26 27 27 shp=shapefile.Reader(shapefilename) 28 expdict=dict( closed=1,density=1)28 expdict=dict(density=1) 29 29 30 30 x=[] … … 33 33 geom=shp.shapes()[i].shapeType 34 34 if geom==5: # polygon 35 expdict['closed']=1 35 36 tmpx=[p[0] for p in shp.shapes()[i].points] 36 37 tmpy=[q[1] for q in shp.shapes()[i].points] … … 38 39 y.append(tmpy) 39 40 elif geom==3: # line 41 expdict['closed']=0 40 42 tmpx=[p[0] for p in shp.shapes()[i].points] 41 43 tmpy=[q[1] for q in shp.shapes()[i].points] … … 43 45 y.append(tmpy) 44 46 elif geom==1: # point 47 expdict['closed']=0 45 48 x.append(shp.shapes()[i].points[0][0]) 46 49 y.append(shp.shapes()[i].points[0][1])
Note:
See TracChangeset
for help on using the changeset viewer.