protected override void Init() { _isReady = true; _isInited = true; _gridStateIndicator = new GridStateIndicator(_fullEnvelope.Clone() as Envelope, _gridDefinition); _fullGridCount = _gridStateIndicator.Width * _gridStateIndicator.Height; }
protected override void Init() { if (_reader == null) { BeginRead(); } string prjFile = Path.Combine(Path.GetDirectoryName(_fileUrl), Path.GetFileNameWithoutExtension(_fileUrl) + ".prj"); try { _spatialRef = SpatialReferenceFactory.GetSpatialReferenceByPrjFile(prjFile); } catch (Exception ex) { Log.WriterException(ex); } _fullEnvelope = _reader.Envelope.Clone() as Envelope; AdjustZeroWidthEnvelope(_fullEnvelope); _shapeType = _reader.ShapeType; _coordType = _spatialRef != null && _spatialRef.ProjectionCoordSystem != null ? enumCoordinateType.Projection : enumCoordinateType.Geographic; _gridStateIndicator = new GridStateIndicator(_fullEnvelope.Clone() as Envelope, _gridDefinition); _fullGridCount = _gridStateIndicator.Width * _gridStateIndicator.Height; _fields = _reader.Fields; _isInited = true; }
public MemoryDataSource(string name, enumShapeType shapeType ) : base(name) { _shapeType = shapeType; _coordType = enumCoordinateType.Geographic; _gridDefinition = new GridDefinition(360, 180); _fullEnvelope = new Envelope(-180, -90, 180, 90); _gridStateIndicator = new GridStateIndicator(_fullEnvelope.Clone() as Envelope, _gridDefinition); _fullGridCount = _gridStateIndicator.Width * _gridStateIndicator.Height; _grid = new Grid(0, _fullEnvelope.Clone() as Envelope, new Feature[] { }); }
public MemoryDataSource(string name, enumShapeType shapeType, enumCoordinateType coordType, Envelope fullEnvelope ) : base(name) { _shapeType = shapeType; _coordType = enumCoordinateType.Geographic; _gridDefinition = new GridDefinition((float)(fullEnvelope.Width + float.Epsilon), (float)(fullEnvelope.Height + float.Epsilon)); _fullEnvelope = fullEnvelope; _gridStateIndicator = new GridStateIndicator(_fullEnvelope.Clone() as Envelope, _gridDefinition); _fullGridCount = _gridStateIndicator.Width * _gridStateIndicator.Height; _grid = new Grid(0, _fullEnvelope.Clone() as Envelope, new Feature[] { }); }
protected override void Init() { if (_reader == null) { BeginRead(); } if (_reader != null) { _spatialRef = _reader.SpatialReference; _coordType = _spatialRef != null && _spatialRef.ProjectionCoordSystem != null ? enumCoordinateType.Projection : enumCoordinateType.Geographic; _fields = _reader.Fields; _fullEnvelope = _reader.Envelope.Clone() as Envelope; //这个非常重要 _gridStateIndicator = new GridStateIndicator(_fullEnvelope.Clone() as Envelope, _gridDefinition); _fullGridCount = _gridStateIndicator.Width * _gridStateIndicator.Height; _shapeType = _reader.ShapeType; _isInited = true; } }
protected override void Init() { FetClassProperty pro = GetFetClassProperty(); if (pro != null) { _fields = pro.Fields; _fullEnvelope = pro.FullEnvelope.Clone() as Envelope; _shapeType = pro.ShapeType; _spatialRef = pro.SpatialReference; _coordType = pro.CoordinateType; _featureCount = pro.FeatureCount; if (_shapeType == enumShapeType.Point) { TryAdjustGridDefinition(); } _gridStateIndicator = new GridStateIndicator(_fullEnvelope.Clone() as Envelope, _gridDefinition); _fullGridCount = _gridStateIndicator.Width * _gridStateIndicator.Height; _isInited = true; } }