空間参照の定義(簡易)

投稿日: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

関連記事

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

Copyright© WINGFIELD since1981 , 2018 All Rights Reserved.