pagerank
路人甲
路人甲
  • 注册日期2004-10-25
  • 发帖数10
  • QQ
  • 铜币131枚
  • 威望0点
  • 贡献值0点
  • 银元0个
阅读:1821回复:2

如何用polygon选择RasterLayer里面的栅格

楼主#
更多 发布于:2006-07-29 02:51
<P>现在用户在地图上画一个的polygon,如何根据这个polygon把它所intersect的栅格图层的Pattern选出来?就像选择矢量图层那样。</P>

<P>谢谢</P>
喜欢0 评分0
gis
gis
管理员
管理员
  • 注册日期2003-07-16
  • 发帖数15951
  • QQ
  • 铜币25345枚
  • 威望15368点
  • 贡献值0点
  • 银元0个
  • GIS帝国居民
  • 帝国沙发管家
  • GIS帝国明星
  • GIS帝国铁杆
1楼#
发布于:2006-07-31 10:45
<TABLE>

<TR>
<TD class=postvalue>
<P>下面的是用点查询cell </P>

<P>The code below shows how to get the X, Y cell sizes and the unit name from the spatial reference. <BR><BR>It works on the selected raster in the Table of Contents. </P></TD></TR>
<TR>
<TH> </TH>
<TD><PRE>Public Sub GetRasterInfo()

  Dim pMxDoc As IMxDocument
  Dim pCurrentLayer As ILayer
  Dim pRasLyr As IRasterLayer
  Dim pRasProps As IRasterProps
  Dim pCellSize As IPnt
  Dim pSpatRef As ISpatialReference
  
  Set pMxDoc = Application.Document
  Set pCurrentLayer = pMxDoc.SelectedLayer
  Set pRasLyr = pCurrentLayer
  Set pRasProps = pRasLyr.Raster
  Set pCellSize = pRasProps.MeanCellSize
  Set pSpatRef = pRasProps.SpatialReference
  
  MsgBox "mean cellsize X  : " ; pCellSize.x ; vbCrLf ; _
         "mean cellsize Y  : " ; pCellSize.y
  
  If pSpatRef Is Nothing Then

    MsgBox "No Spatial Reference"
    Exit Sub

  ElseIf TypeOf pSpatRef Is IProjectedCoordinateSystem Then

    Dim pProjCoordSys As IProjectedCoordinateSystem
    Dim pLinearUnit As ILinearUnit
    
    Set pProjCoordSys = pSpatRef
    Set pLinearUnit = pProjCoordSys.CoordinateUnit
    
    MsgBox pLinearUnit.Name
        
  ElseIf TypeOf pSpatRef Is IGeographicCoordinateSystem Then

    Dim pGeogCoordSys As IGeographicCoordinateSystem
    Dim pAngularUnit As IAngularUnit
    
    Set pGeogCoordSys = pSpatRef
    Set pAngularUnit = pGeogCoordSys.CoordinateUnit
    
    MsgBox pAngularUnit.Name
    
  Else

    MsgBox "Unknown coordinate system"

  End If      

End Sub
</PRE> </TD></TR></TABLE>
GIS麦田守望者,期待与您交流。
举报 回复(0) 喜欢(0)     评分
pagerank
路人甲
路人甲
  • 注册日期2004-10-25
  • 发帖数10
  • QQ
  • 铜币131枚
  • 威望0点
  • 贡献值0点
  • 银元0个
2楼#
发布于:2006-08-02 23:15
<P>谢谢楼上的回复。</P>
<P>但是好像和我要的不一样。我想要的不仅仅是被Polygon覆盖住的cells,而且包括那些被盖住一部分的raster polygons。 -》 Intersect</P>
举报 回复(0) 喜欢(0)     评分
游客

返回顶部