Hello,I'm developing a C# application with an ESRI map engine.One of my requirements is to enable the user to define custom Datum with 3 parameters (linear shift) to be used within some Coordinate Systems.A small sample will be appreciated 🙂Thanks
// Initialize a new spatial reference environment. // SpatialReferenceEnvironment is a singleton object and needs to use the Activator class. Type factoryType = Type.GetTypeFromProgID("esriGeometry.SpatialReferenceEnvironment"); System.Object obj = Activator.CreateInstance(factoryType); ISpatialReferenceFactory2 pSRF = obj as ISpatialReferenceFactory2; // Initialize and create the input and output coordinate systems. IProjectedCoordinateSystem2 pPCSin = new ESRI.ArcGIS.Geometry.ProjectedCoordinateSystemClass(); IProjectedCoordinateSystem2 pPCSout = new ESRI.ArcGIS.Geometry.ProjectedCoordinateSystemClass(); pPCSin = (IProjectedCoordinateSystem2)pSRF.CreateProjectedCoordinateSystem((int)esriSRProjCSType.esriSRProjCS_Abidjan1987UTM_30N); pPCSout = (IProjectedCoordinateSystem2)pSRF.CreateProjectedCoordinateSystem((int)esriSRProjCSType.esriSRProjCS_WGS1984UTM_30N); IGeographicCoordinateSystem2 pGCSto; IGeographicCoordinateSystem2 pGCSfrom; // Retrieve the geographic coordinate systems from the // two projected coordinate systems pGCSfrom = (IGeographicCoordinateSystem2)pPCSin.GeographicCoordinateSystem; pGCSto = (IGeographicCoordinateSystem2)pPCSout.GeographicCoordinateSystem; // Initialize and create an appropriate geographic transformation. ICoordinateFrameTransformation pCFT; pCFT = new CoordinateFrameTransformationClass(); pCFT.PutParameters(1.234, -2.345, 658.3, 4.3829, -2.48591, 2.18943, 2.48585); pCFT.PutSpatialReferences(pGCSfrom,pGCSto); pCFT.Name = "Custom GeoTran";
Přihlášení členové mohou přispívat, sledovat aktualizace a další. Jste tu noví? Zaregistrujte si bezplatný účet.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.