如何使用C#保存shapefile? [英] How to save a shapefile using C#?

查看:246
本文介绍了如何使用C#保存shapefile?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经使用地图控件在另一层上添加了一层(例如,在world_adm0.shp上,我已经添加了india_ds.shp).现在,我想将此地图另存为shapefile.
我的代码正在保存它,但没有打开它,因为它显示了无效的文件格式.
要创建shapefile,需要三种文件格式(.shp,.shx,.dbf),但我无法创建它.

I have added one layer on another layer using map control (eg on world_adm0.shp i have added india_ds.shp). Now I want to save this map as a shapefile.
My code is saving it but not opening it as it showing invalid file fomat.
For creating a shapefile three file formats is needed (.shp , .shx , .dbf) but i am unable to create it.

推荐答案

地图的意思是什么控制 ? .NET中没有地图控件.
What do you mean by map control ? There''s no map control in .NET.


不要第二次重新发布相同的问题.
Don''t repost the same question a second time.


如果您使用的是MapWinGis然后控制打开文件

sh.SaveAs(文件名,空)

其中
sh是Shape类的对象
文件名是您想要的名称,即.shp
If you are using MapWinGis Control to open file then

sh.SaveAs(filename,null)

where
sh is Object of Shape class
filename is you want to give i.e. .shp


这篇关于如何使用C#保存shapefile?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆