private FeatureData GetFeatureData(GetFeatures getFeatures, FieldSelection fieldSelection) { CheckIsFeatureLayer(); Features features = (Features)_service.Send(getFeatures); FeatureData featureData = fieldSelection.CreateFeatureData(); featureData.LayerName = Name; LoadFeatureData(features, featureData, fieldSelection); if (features.FeatureCount.HasMore) { getFeatures.BeginRecord = 1; do { getFeatures.BeginRecord += features.FeatureCount.Count; features = (Features)_service.Send(getFeatures); LoadFeatureData(features, featureData, fieldSelection); }while (features.FeatureCount.HasMore); } return(featureData); }
private List <String> GetFeatureIDs(GetFeatures getFeatures) { CheckIsFeatureLayer(); CheckHasFeatureIDField(); Features features = (Features)_service.Send(getFeatures); List <String> idList = GetIDList(features); if (features.FeatureCount.HasMore) { getFeatures.BeginRecord = 1; do { getFeatures.BeginRecord += features.FeatureCount.Count; features = (Features)_service.Send(getFeatures); idList.AddRange(GetIDList(features)); }while (features.FeatureCount.HasMore); } idList.Sort(); for (int i = idList.Count - 1; i >= 1; --i) { if (String.Compare(idList[i], idList[i - 1], false) == 0) { idList.RemoveAt(i); } } return(idList); }
public object Get(GetFeatures request) { List <WebFeature> result = new List <WebFeature>(); var context = TepWebContext.GetWebContext(PagePrivileges.EverybodyView); try { context.Open(); context.LogInfo(this, string.Format("/feature GET")); EntityList <Terradue.Portal.Feature> feats = new EntityList <Terradue.Portal.Feature>(context); feats.Load(); List <Terradue.Portal.Feature> features = feats.GetItemsAsList(); features.Sort(); foreach (Terradue.Portal.Feature f in features) { result.Add(new WebFeature(f)); } context.Close(); } catch (Exception e) { context.LogError(this, e.Message, e); context.Close(); throw e; } return(result); }
public override DataTable GetFeatureTable(string fieldNames, string where, IGeometry shape) { FieldSelection fieldSelection = new FieldSelection(this, fieldNames); SpatialQuery query = new SpatialQuery(where, shape); query.Subfields = fieldSelection.NamesToString(" "); GetFeatures getFeatures = new GetFeatures(ID, query); getFeatures.DataFrame = DataFrame.Name; getFeatures.Geometry = fieldSelection.Fields.Any(lyr => lyr.Type == CommonFieldType.Geometry); return(GetFeatureTable(getFeatures, fieldSelection)); }
public override List <String> GetFeatureIDs(string where, IGeometry shape) { SpatialQuery query = new SpatialQuery(where, shape); query.Subfields = FeatureIDField.Name; GetFeatures getFeatures = new GetFeatures(ID, query); getFeatures.Geometry = false; getFeatures.DataFrame = DataFrame.Name; return(GetFeatureIDs(getFeatures)); }
public override Envelope GetFeatureExtent(string where) { CheckIsFeatureLayer(); Query query = new Query(where); GetFeatures getFeatures = new GetFeatures(ID, query); getFeatures.GlobalEnvelope = true; getFeatures.Envelope = false; getFeatures.Geometry = false; getFeatures.Attributes = false; getFeatures.DataFrame = DataFrame.Name; Features features = (Features)_service.Send(getFeatures); return(features.FeatureCount.Count > 0 ? features.Envelope : new Envelope()); }
public override int GetFeatureCount(string where, IGeometry shape) { CheckIsFeatureLayer(); SpatialQuery query = new SpatialQuery(where); query.Subfields = "#ID#"; GetFeatures getFeatures = new GetFeatures(ID, query); getFeatures.Attributes = false; getFeatures.Geometry = false; getFeatures.DataFrame = DataFrame.Name; if (shape != null) { query.SpatialFilter = new SpatialFilter(shape); } Features features = (Features)_service.Send(getFeatures); return(features.FeatureCount.Count); }
private DataTable GetFeatureTable(GetFeatures getFeatures, FieldSelection fieldSelection) { CheckIsFeatureLayer(); Features features = (Features)_service.Send(getFeatures); DataTable table = fieldSelection.CreateTable(); LoadFeatureTable(features, table, fieldSelection); if (features.FeatureCount.HasMore) { getFeatures.BeginRecord = 1; do { getFeatures.BeginRecord += features.FeatureCount.Count; features = (Features)_service.Send(getFeatures); LoadFeatureTable(features, table, fieldSelection); }while (features.FeatureCount.HasMore); } return(table); }