Why is every Attribut, except OBJECTID, from this ArcGIS Query returning null?

16 Views Asked by At

Im trying to build an App in android Studio with the ArcGis API. While building an Adapter I noticed, that all the Attributes, except "OBJECTID", is returning null, even though they actually have content. It is also not returning every attribute. Essientially this query asks the server for features in an area of 1000m around the user. This in itself works, it creates 3 Obstacle Objects. Does anyone has an Idea how to fix this or get the other attributes using the OBJECTID? Help is much appreciated! Thanks in advance

public void queryFeatures(Location location, int radius){
    double userLat = location.getLatitude();
    double userLon = location.getLongitude();
    com.esri.arcgisruntime.geometry.Point userLocation = new com.esri.arcgisruntime.geometry.Point(userLon, userLat, SpatialReferences.getWgs84());
    LinearUnit unit = new LinearUnit(LinearUnitId.METERS);
    // Defining a circle around the users position
    Geometry bufferGeometry = GeometryEngine.bufferGeodetic(userLocation, radius, unit, Double.NaN, GeodeticCurveType.GEODESIC);

    // Defining the query paramteres
    QueryParameters queryParameters = new QueryParameters();
    queryParameters.setGeometry(bufferGeometry);
    queryParameters.setSpatialRelationship(QueryParameters.SpatialRelationship.INTERSECTS);

    // the actual query
    final ListenableFuture<FeatureQueryResult> queryResult = mServiceFeatureTable.queryFeaturesAsync(queryParameters);
    queryResult.addDoneListener(() -> {
        try {
            FeatureQueryResult result = queryResult.get();
            for (Feature feature : result){
                if (Obstacle.doesObstacleExist((ArcGISFeature) feature)) {
                    ArcGISFeature arcGISFeature = (ArcGISFeature) feature;
                    Map attr = arcGISFeature.getAttributes();
                    locationManager.addObserver(new Obstacle((ArcGISFeature) feature));
                }
            }
        } catch (Exception e) {
            Log.d("featurequery", e.getMessage());
        }
    });
}
0

There are 0 best solutions below