爱气象,爱气象家园! 

气象家园

 找回密码
 立即注册

QQ登录

只需一步,快速开始

新浪微博登陆

只需一步, 快速开始

搜索
查看: 3312|回复: 6

请问:如何从一个shp文件获取shape

[复制链接]

新浪微博达人勋

发表于 2015-3-1 21:46:36 | 显示全部楼层 |阅读模式

登录后查看更多精彩内容~

您需要 登录 才可以下载或查看,没有帐号?立即注册 新浪微博登陆

x
最近在写一篇论文,想提取出所有消失在中国大陆的台风:

            string aFile = @"E:\map\china.shp";
            MapLayer aLayer = MapDataManage.OpenLayer(aFile);
            MeteoInfoC.Shape.PolygonShape china = new PolygonShape();

            MeteoInfoC.PointD pt = new MeteoInfoC.PointD(m7.lonCentre[ptN], m7.latCenter[ptN]);//台风的最后一个点
            if (MeteoInfoC.Geoprocess.GeoComputation.PointInPolygon(china, pt))
。。。。。


            怎么从alayer来得到china这个polygon(或者polygonshape)呢?

            非常感谢。

密码修改失败请联系微信:mofangbao

新浪微博达人勋

发表于 2015-3-2 10:30:31 | 显示全部楼层
shp文件不会用啊 可以从原本写好的ncl'文件改吗?
密码修改失败请联系微信:mofangbao

新浪微博达人勋

发表于 2015-3-2 10:57:27 | 显示全部楼层
aLayer.ShapeList[0]
密码修改失败请联系微信:mofangbao

新浪微博达人勋

 楼主| 发表于 2015-3-2 12:00:40 | 显示全部楼层
非常感谢王老师,已经转出来了
在Maplayer中没有shapeList这个属性,
先将将MapLayer转成VectorLayer,然后获取shapelist就可以了。
MeteoInfo帮了我很多很多忙。感谢王老师的无私奉献。
            string aFile = @"E:\china.shp";
            VectorLayer aLayer = (VectorLayer)MapDataManage.OpenLayer(aFile);
            MeteoInfoC.Shape.PolygonShape china = (PolygonShape)aLayer.ShapeList[0];
密码修改失败请联系微信:mofangbao

新浪微博达人勋

发表于 2015-3-6 11:16:08 | 显示全部楼层
如何从一个shp文件获取shape
密码修改失败请联系微信:mofangbao

新浪微博达人勋

 楼主| 发表于 2015-5-10 21:38:03 | 显示全部楼层
再请问一下王博士,
MeteoInfoC.Geoprocess.GeoComputation.PointInPolygon(polygon, point)
这个函数的返回结果中,
如果polygon是多个多面的,
那么是不是只要point进入任何一个面都会返回true?
密码修改失败请联系微信:mofangbao

新浪微博达人勋

发表于 2015-5-11 08:34:46 | 显示全部楼层
Mc.Fish 发表于 2015-5-10 21:38
再请问一下王博士,
MeteoInfoC.Geoprocess.GeoComputation.PointInPolygon(polygon, point)
这个函数的返 ...

是的
密码修改失败请联系微信:mofangbao
您需要登录后才可以回帖 登录 | 立即注册 新浪微博登陆

本版积分规则

Copyright ©2011-2014 bbs.06climate.com All Rights Reserved.  Powered by Discuz! (京ICP-10201084)

本站信息均由会员发表,不代表气象家园立场,禁止在本站发表与国家法律相抵触言论

快速回复 返回顶部 返回列表