shapefile转换evf 时岛的处理办法
2014-01-06 15:35
459 查看
在shp文件转换为evf的时候。如果shp文件的polygon存在岛的话,转换的evf是有问题的。解决方法,是读取shp中的所有部分。
pro shapefileToEvf compile_opt idl2 ENVI, /RESTORE_BASE_SAVE_FILES ENVI_BATCH_INIT, LOG_FILE='batch.txt' ;打开shp文件 shapefile='C:\Users\younglimpo\Desktop\掩膜\sheng.shp' ;读取投影信息,并由此创建投影文件 projstr='C:\Users\younglimpo\Desktop\掩膜\sheng.prj' openr,lun,projstr,/get_lun shpPrjString='' readf,lun,shpPrjString free_lun,lun shapfeProjection=envi_proj_create(type=42,pe_coord_sys_str=shpPrjString) ;读取shp文件的信息 oshp=OBJ_NEW('IDLffShape',shapefile) oshp->getproperty,n_entities=n_ent,Attribute_info=attr_info,n_attributes=n_attr,Entity_type=ent_type ;创建evf文件 ent=oshp->GetEntity(0) N_VERTICES=ent.N_VERTICES ;错误解决办法 ;就是是加入下面的两句代码 ; parts=*(ent.parts) parts_ptr=[0,parts[1],-(parts[2]),-(parts[3]),-(N_VERTICES-1)] vert=*(ent.vertices) evfpath= 'd:\dhfTwoTest.evf' evf_ptr = envi_evf_define_init(evfpath,$ projection=shapfeProjection,data_type=5,$ layer_name='省') envi_evf_define_add_record,evf_ptr,vert,parts_ptr=parts_ptr,type=5 evf_id = envi_evf_define_close(evf_ptr,/return_id) envi_evf_close,evf_id attr=oshp->GetAttributes(/All) ;写入属性 envi_write_dbf_file, 'dhfTwoTest.dbf', attr Obj_destroy,oshp end
相关文章推荐
- 无法将类型“string”隐式转换为“int”的处理办法
- springmvc时间日期转换常见处理办法
- CDM转换成PDM有些实体没有生成的处理办法
- springmvc/springboot处理前台字符串日期自动转换成后台date类型的三种办法
- springmvc/springboot处理前台字符串日期自动转换成后台date类型的三种办法
- iOS调试——部分日期字符串转换成NSDate对象为nil处理办法
- 百度JSP版坐标转换 限定不大于10个每次的处理办法
- [***码农]当Excel数据慌乱数据 导入数据库后或转换数据的处理办法
- 公司、办公司内如何限制上外网因特网、只能连内网局域网 - 注册表工具软件、批处理办法 - 注册表转换成批处理BAT,批处理如何修改注册表
- Eclipse中英文版转换 及 拋异常处理办法
- ENVI\IDL shp转换evf 由于shp中polygon的岛导致的问题的解决办法
- [Wap]OnViewStateExpire异常的处理办法
- vm 蓝屏问题处理办法
- exp导出数据提示数据块损坏的处理办法
- error: C2664: 不能将参数从“const char *”转换为“LPCWSTR” 的解决办法
- Geodatabase对象被锁定的处理办法
- 互相引用项目开发中编译问题处理办法
- Linux下链接文件使用RM无法删除的处理办法
- Autotools的一些小问题的处理办法
- mongodb 循环处理表数据 时间转换