public IPlugInCursorHelper FetchByEnvelope(int ClassIndex, IEnvelope env, bool strictSearch, string WhereClause, object FieldMap) { if (this.DatasetType == esriDatasetType.esriDTTable) { return(null); } //env passed in always has same spatial reference as the data //for identify, it will check if search geometry intersect dataset bound //but not ITable.Search(pSpatialQueryFilter, bRecycle) etc //so here we should check if input env falls within extent IEnvelope boundEnv = this.Bounds; boundEnv.Project(env.SpatialReference); if (boundEnv.IsEmpty) { return(null); //or raise error? } try { SimplePointCursor spatialCursor = new SimplePointCursor(m_fullPath, this.get_Fields(ClassIndex), -1, (System.Array)FieldMap, env, this.geometryTypeByID(ClassIndex)); setMZ(spatialCursor, ClassIndex); return((IPlugInCursorHelper)spatialCursor); } catch (Exception ex) { System.Diagnostics.Debug.WriteLine(ex.Message); return(null); } }
public IPlugInCursorHelper FetchAll(int ClassIndex, string WhereClause, object FieldMap) { try { SimplePointCursor allCursor = new SimplePointCursor(m_fullPath, this.get_Fields(ClassIndex), -1, (System.Array)FieldMap, null, this.geometryTypeByID(ClassIndex)); setMZ(allCursor, ClassIndex); return((IPlugInCursorHelper)allCursor); } catch (Exception ex) { System.Diagnostics.Debug.WriteLine(ex.Message); return(null); } }
public IPlugInCursorHelper FetchByID(int ClassIndex, int ID, object FieldMap) { try { SimplePointCursor idCursor = new SimplePointCursor(m_fullPath, this.get_Fields(ClassIndex), ID, (System.Array)FieldMap, null, this.geometryTypeByID(ClassIndex)); setMZ(idCursor, ClassIndex); return((IPlugInCursorHelper)idCursor); } catch (Exception ex) //will catch NextRecord error if it reaches EOF without finding a record { System.Diagnostics.Debug.WriteLine(ex.Message); return(null); } }
private void setMZ(SimplePointCursor sptCursor, int Index) { sptCursor.HasM = ((Index >= 3 && Index < 6) || Index >= 9); sptCursor.HasZ = (Index >= 6); }