Closed DShokes closed 8 years ago
I'm not sure if QueryAllFeatures is intended to be used in place of directly running query on the FeatureLayer object. There are differences when the query returns no features.
>>>featureLayer.query(where = '1=2').features
[]
>>> featureLayer.query(where = '1=2')
<arcrest.common.general.FeatureSet object at 0x13F44EF0>
# but
>>> fst.QueryAllFeatures(url = featureLayer.url,sql = '1=2')
{'message': 'No features matched the query', 'success': True}
Instead of returning a dict, could it return a featureSet:
if total == 0:
print({'success':True, 'message':"No features matched the query"})
return fl.query(where=sql, returnGeometry=True, out_fields=out_fields)
This would allow for easier replacement of query with QueryAllFeatures without worrying about breaking later FeatureSet property usage, such as fst.QueryAllFeatures(url = featureLayer.url,sql = '1=2').features
.
Enhancement add, please verify
looks great thanks!
>>> fst.QueryAllFeatures(flTrees.url, outSR = 4326)
4205 features to be downloaded
24% Completed: 1000/4205
48% Completed: 2000/4205
71% Completed: 3000/4205
95% Completed: 4000/4205
100% Completed: 4205/4205
<arcrest.common.general.FeatureSet object at 0x152B2190>
When a query returns no features. REST responds with:
{
"objectIdFieldName" : "OBJECTID",
"globalIdFieldName" : "GlobalID",
"features" : []
}
fst.QueryAllFeatures
only returns []
try now,
ArcRest or ArcRestHelper
ArcRestHelper
Version or date of download
3.5.3
Bug or Enhancement
Enhancement
Repo Steps or Enhancement details
Please allow arcresthelper featureservicetools QueryAllFeatures to return the features in a specific spatial reference by adding an optional "outSR" argument:
Thanks
Edit: geometryFilter would be great too!