internal Esri.ArcGISRuntime.Geometry.Geometry ReadGeography(System.Spatial.Geography geography)
        {
            if (geography == null)
            {
                throw new ArgumentNullException("geography");
            }

            Esri.ArcGISRuntime.Geometry.SpatialReference sr = null;
            if (geography.CoordinateSystem.EpsgId.HasValue && geography.CoordinateSystem.EpsgId.Value > 0)
            {
                sr = Esri.ArcGISRuntime.Geometry.SpatialReference.Create(geography.CoordinateSystem.EpsgId.Value);
            }
            if (geography is System.Spatial.GeographyPoint)
            {
                return(ReadGeographyPoint((System.Spatial.GeographyPoint)geography, sr));
            }
            if (geography is System.Spatial.GeographyMultiPoint)
            {
                return(ReadGeographyMultiPoint((System.Spatial.GeographyMultiPoint)geography, sr));
            }
            if (geography is System.Spatial.GeographyLineString)
            {
                return(ReadGeographyLineString((System.Spatial.GeographyLineString)geography, sr));
            }
            if (geography is System.Spatial.GeographyMultiLineString)
            {
                return(ReadGeographyMultiLineString((System.Spatial.GeographyMultiLineString)geography, sr));
            }
            if (geography is System.Spatial.GeographyPolygon)
            {
                return(ReadGeographyPolygon((System.Spatial.GeographyPolygon)geography, sr));
            }
            if (geography is System.Spatial.GeographyMultiPolygon)
            {
                return(ReadGeographyMultiPolygon((System.Spatial.GeographyMultiPolygon)geography, sr));
            }
            throw new NotImplementedException();
        }
Пример #2
0
 public static Geometry FromSystemSpatialGeography(this System.Spatial.Geography geography)
 {
     return(new SystemSpatialConverter().ReadGeography(geography));
 }