예제 #1
0
 public void add(OGRBufferCacheRow row)
 {
     this.setEnvelope(row.envelope);
     this._rows.Add(row);
     if (this._spatialIndex != null)
     {
         this._spatialIndex.add(row);
     }
 }
예제 #2
0
 public void add(OGRBufferCacheRow row)
 {
     this.setEnvelope(row.envelope);
     this._rows.Add(row);
     if (this._spatialIndex != null)
     {
         this._spatialIndex.add(row);
     }
 }
예제 #3
0
        public List <OGRBufferCacheRow> crosses(OGRBufferCacheRow other)
        {
            List <OGRBufferCacheRow> candidateRows = this.getCandidates(other);
            List <OGRBufferCacheRow> returnRows    = new List <OGRBufferCacheRow>();

            foreach (OGRBufferCacheRow row in candidateRows)
            {
                if (row.geometry.Crosses(other.geometry))
                {
                    returnRows.Add(row);
                }
            }
            return(returnRows);
        }
예제 #4
0
        private List <OGRBufferCacheRow> getCandidates(OGRBufferCacheRow other)
        {
            List <OGRBufferCacheRow> rows;

            if (this._spatialIndex != null)
            {
                rows = this._spatialIndex.query(other);
            }
            else
            {
                rows = this._rows;
            }
            return(rows);
        }
예제 #5
0
        public List<OGRBufferCacheRow> crosses(OGRBufferCacheRow other)
        {
            List<OGRBufferCacheRow> candidateRows = this.getCandidates(other);
            List<OGRBufferCacheRow> returnRows = new List<OGRBufferCacheRow>();

            foreach (OGRBufferCacheRow row in candidateRows)
            {
                if (row.geometry.Crosses(other.geometry))
                {
                    returnRows.Add(row);
                }
            }
            return returnRows;
        }
예제 #6
0
        public override void ProcessInput(int inputID, PipelineBuffer buffer)
        {
            OGRBufferCache cache = null;
            int geomIndex = -1;

            if (inputID == this._targetID)
            {
                cache = this._targetCache;
                geomIndex = this._targetGeomIndex;

            }
            else if (inputID == this._joinID)
            {
                cache = this._joinCache;
                geomIndex = this._joinGeomIndex;
            }

            while (buffer.NextRow())
            {
                object[] bufferRow = new object[buffer.ColumnCount];
                for (int i = 0; i < buffer.ColumnCount; i++)
                {
                    if (buffer[i] is BlobColumn)
                    {
                        int blobSize = (int)buffer.GetBlobLength(i);
                        byte[] blob = buffer.GetBlobData(i, 0, blobSize);
                        bufferRow[i] = blob;
                    }
                    else
                    {
                        bufferRow[i] = buffer[i];
                    }

                }
                Geometry geom = Geometry.CreateFromWkb((byte[])bufferRow[geomIndex]);
                OGRBufferCacheRow row = new OGRBufferCacheRow(bufferRow, geom);
                cache.add(row);
            }

            if (buffer.EndOfRowset) { this._inputCount += 1; }

            if (this._inputCount == 2)
            {
                this._targetCache.createSpatialIndex();

                foreach (OGRBufferCacheRow row in this._joinCache)
                {
                    List<OGRBufferCacheRow> results = null;
                    switch (this._relation)
                    {
                        case relationType.contains:
                            results = this._targetCache.contains(row);
                            break;
                        case relationType.crosses:
                            results = this._targetCache.crosses(row);
                            break;
                        case relationType.equals:
                            results = this._targetCache.equals(row);
                            break;
                        case relationType.intersects:
                            results = this._targetCache.intersects(row);
                            break;
                        case relationType.overlaps:
                            results = this._targetCache.overlaps(row);
                            break;
                        case relationType.touches:
                            results = this._targetCache.touches(row);
                            break;
                        case relationType.within:
                            results = this._targetCache.within(row);
                            break;
                    }

                    if (results.Count > 0)
                    {
                        foreach (OGRBufferCacheRow resultRow in results)
                        {
                            this._outputBuffer.AddRow();

                            foreach (columnInfoMap ci in this._joinColumnInfoMapList)
                            {
                                this._outputBuffer[ci.outputBufferIndex] = row[ci.inputBufferIndex];
                            }
                            foreach (columnInfoMap ci in this._targetColumnInfoMapList)
                            {
                                this._outputBuffer[ci.outputBufferIndex] = resultRow[ci.inputBufferIndex];
                            }
                        }
                    }
                }
                this._outputBuffer.SetEndOfRowset();
            }
        }
예제 #7
0
 private List<OGRBufferCacheRow> getCandidates(OGRBufferCacheRow other)
 {
     List<OGRBufferCacheRow> rows;
     if (this._spatialIndex != null)
     {
         rows = this._spatialIndex.query(other);
     }
     else
     {
         rows = this._rows;
     }
     return rows;
 }