Exemplo n.º 1
0
        public RstReader(string filename)
        {
            _geoImage = IGeoImage.GeoOpen(filename);
            GeoImage g = _geoImage as GeoImage;

            _fullEnvelope      = new Envelope(g.MinX, g.MinY, g.MaxX, g.MaxY);
            _coordType         = g.IsProjected ? enumCoordinateType.Projection : enumCoordinateType.Geographic;
            _sref              = SpatialReferenceFactory.GetSpatialReferenceByWKT(g.ProjectDescription, enumWKTSource.GDAL);
            _byteCountPerPixel = GetBandCount(_geoImage.DataType);
        }
Exemplo n.º 2
0
        public FeatureSplitterByProjection(string spatialRef)
        {
            ISpatialReference spRef = SpatialReferenceFactory.GetSpatialReferenceByWKT(spatialRef, enumWKTSource.EsriPrjFile);

            if (spRef != null)
            {
                _computer    = new SplitRangesComputer(spRef);
                _isNeedSplit = _computer.ComputeValidGeoRange(out _centerLont, out _minLat, out _maxLat, out _minLon, out _maxLon);
            }
        }
Exemplo n.º 3
0
        public static MapArguments FromXElement(XElement ele)
        {
            if (ele == null)
            {
                return(null);
            }
            MapArguments arg = new MapArguments();

            arg.BackColor = ColorHelper.StringToColor(ele.Attribute("backcolor").Value);
            if (ele.Element("FullExtent") != null)
            {
                arg.FullExtent = XElementToEnvelope(ele.Element("FullExtent"));
            }
            if (ele.Element("Extent") != null)
            {
                arg.Extent = XElementToEnvelope(ele.Element("Extent"));
            }
            if (ele.Attribute("smoothingmode") != null)
            {
                string        sm    = ele.Attribute("smoothingmode").Value;
                SmoothingMode smode = SmoothingMode.Default;
                foreach (SmoothingMode s in Enum.GetValues(typeof(SmoothingMode)))
                {
                    if (s.ToString() == sm)
                    {
                        smode = s;
                        break;
                    }
                }
                arg.SmoothingMode = smode;
            }
            if (ele.Attribute("spatialreference") != null)
            {
                try
                {
                    string sf = ele.Attribute("spatialreference").Value;
                    arg._targetSpatialReference = SpatialReferenceFactory.GetSpatialReferenceByWKT(sf, enumWKTSource.EsriPrjFile);
                }
                catch (Exception ex)
                {
                    Log.WriterException(ex);
                }
            }
            return(arg);
        }