CreateESRISpatialReferenceFromPRJ 怎么用
发布网友
发布时间:2022-05-21 08:57
我来回答
共1个回答
热心网友
时间:2023-10-21 13:36
[C#]
public void CreateESRISpatialReferenceFromPRJFileExample()
{ //The
ISpatialReferenceFactory::CreateESRISpatialReferenceFromPRJFile
//method requires that you specify the path and filename of the PRJ
//file you wish to import to create a spatial reference from.
// use activator class with SpatialReferenceEnvironment
singleton Type factoryType =
Type.GetTypeFromProgID("esriGeometry.SpatialReferenceEnvironment");
System.Object obj = Activator.CreateInstance(factoryType);
ISpatialReferenceFactory3 spatialReferenceFactory = obj as
ISpatialReferenceFactory3;
ISpatialReference spatialReference =
spatialReferenceFactory.
CreateESRISpatialReferenceFromPRJFile("C:\\Program Files\\ArcGIS\\Coordinate
Systems\\Geographic Coordinate Systems\\World\\WGS 1984.prj");
}
[Visual Basic .NET]
'The ISpatialReferenceFactory::CreateESRISpatialReferenceFromPRJFile
'method requires that you specify the path and filename of the
PRJ 'file you wish to import to create a spatial reference from.
Dim pSpatRefFact As
ESRI.ArcGIS.Geometry.ISpatialReferenceFactory pSpatRefFact = New
ESRI.ArcGIS.Geometry.SpatialReferenceEnvironment
Dim pSpatRef As ESRI.ArcGIS.Geometry.ISpatialReference
pSpatRef =
pSpatRefFact.CreateESRISpatialReferenceFromPRJFile("c:\geodata\prj_import.prj")