I am wondering how to return the results of a result set from a query against an online feature service. The example code for FeatureLayerQuerySample.java does work for returning a single result. Of course the reason is for the if condition. However, if I change the query to
query.setWhereClause("objectid < 10") ;
and modify the if to a while loop, I will only get one object id when I should have multiple. Additionally, the while loop never stops. What am I missing?
while (result.iterator().hasNext()) { // was an if statement
// get state feature and zoom to it
Feature feature = result.iterator().next();
System.out.println(feature.getAttributes().get("objectid"));
Is there a bug? I really want to start using this SDK but I am constantly running into problems. The online query in the last java release works but is somewhat cumbersome and I have a requirement to transfer some of the data of my online feature services into a database or flat file so another application can consume my GIS table data.
Ref: https://developers.arcgis.com/java/latest/sample-code/feature-layer-query.htm