YouTube | Facebook | Twitter  Feed

空間参照の定義(簡易)

2016/9/1 (木)

Function fncSpatialReference(valType As Long, blnGeographic As Boolean) As ISpatialReference
 
'DeveloperHelpから以下を参照
 
'地理座標系(pcsType)
'esriSRGeoCSType Contains
'esriSRGeoCS2Type Constants
'esriSRGeoCS3Type Constants
 
'投影座標系(gcsType)
'esriSRProjCSType Constants
'esriSRProjCS2Type Constants
'esriSRProjCS3Type Constants
'esriSRProjCS4Type Constants
 
'例
valType = esriSRProjCS4Type.esriSRProjCS_JGD2000_Japan_Zone_9     'JGD2000 平面直角座標系第9系
valType = esriSRGeoCS3Type.esriSRGeoCS_JapanGeodeticDatum2000    'JGD2000 地理座標系
 
Dim pSpatialReferenceFactory As ISpatialReferenceFactory
Set pSpatialReferenceFactory = New SpatialReferenceEnvironment
 
If blnGeographic = True Then
    Dim pGeographicCoordinateSystem As IGeographicCoordinateSystem
    Set pGeographicCoordinateSystem = pSpatialReferenceFactory.CreateGeographicCoordinateSystem(valType)
     
    Set fncSpatialReference = pGeographicCoordinateSystem
     
Else
    Dim pProjectedCoordinateSystem As IProjectedCoordinateSystem
    Set pProjectedCoordinateSystem = pSpatialReferenceFactory.CreateProjectedCoordinateSystem(valType)
 
    Set fncSpatialReference = pProjectedCoordinateSystem
End If
 
 
'XY座標精度の設定(9.2以降は設定必須)
Dim pSpatialReferenceResolution  As ISpatialReferenceResolution
Set pSpatialReferenceResolution = fncSpatialReference
pSpatialReferenceResolution.SetDefaultXYResolution
 
'XY許容値の設定(9.2以降は設定必須)
Dim pSpatialReferenceTolerance  As ISpatialReferenceTolerance
Set pSpatialReferenceTolerance = fncSpatialReference
pSpatialReferenceToleranceT.SetDefaultXYTolerance
  
End Function

関連記事

  • この記事を書いた人

羽田 康祐

好きな地図投影法 はパース・クィンカンシャル図法とマクブライド・トーマス平極四次曲線図法。広島市出身。GIS上級技術者、Esri認定インストラクター、測量士補、潜水士、元PADIダイブマスター、四アマ。GIS を使った自己紹介はこちら。ESRIジャパン(株)所属、発言は個人の見解です。

-プログラミング, ArcGIS
-,

© 2021 WINGFIELD since1981