Beispiel #1
0
        /// <summary>
        /// Node return WKT code of assigned CS of drawing
        /// </summary>
        /// <returns></returns>
        public static string GetWKTFromDrawing()
        {
            Autodesk.Gis.Map.Platform.AcMapMap map = Autodesk.Gis.Map.Platform.AcMapMap.GetCurrentMap();
            string wkt = map.GetMapSRS();

            return(wkt);
        }
Beispiel #2
0
        /// <summary>
        /// Get EPSG code for assigned to drawing coordinate system as string value
        /// </summary>
        /// <returns></returns>
        public static string GetEPSGForCurrentCS()
        {
            Autodesk.Gis.Map.Platform.AcMapMap       map     = Autodesk.Gis.Map.Platform.AcMapMap.GetCurrentMap();
            OSGeo.MapGuide.MgCoordinateSystemFactory factory = new OSGeo.MapGuide.MgCoordinateSystemFactory();
            string wkt  = map.GetMapSRS();
            string EPSG = factory.ConvertWktToEpsgCode(wkt).ToString();

            return(EPSG);
        }
Beispiel #3
0
        /// <summary>
        /// Node GetCurrentCoordinateSystem return the name of current CS (assigned to drawing)
        /// </summary>
        /// <returns></returns>
        public static string GetCurrentCoordinateSystem()
        {
            Autodesk.Gis.Map.Platform.AcMapMap map = Autodesk.Gis.Map.Platform.AcMapMap.GetCurrentMap();
            string wkt = map.GetMapSRS();

            OSGeo.MapGuide.MgCoordinateSystemFactory factory = new OSGeo.MapGuide.MgCoordinateSystemFactory();
            string csCode = factory.ConvertWktToCoordinateSystemCode(wkt);

            return(csCode);
        }