I am querying a feature layer provided in ArcGIS Online as explained in the Query (Feature Service) documentation. Everywhere there are examples using JavaScript. I am not able to find any documentation or examples using Java.
I have tried the same thing using Spring's RestTemplate class as below
MultiValueMap<String, String> variables = new LinkedMultiValueMap<>();
variables.add("where", "1 = 1");
variables.add("f", "json");
variables.add("outFields", "*");
HttpHeaders headers = new HttpHeaders();
headers.setContentType(MediaType.APPLICATION_FORM_URLENCODED);
HttpEntity<MultiValueMap<String, String>> entity = new HttpEntity<>(variables, headers);
RestTemplate restTemplate = new RestTemplate();
String queryData = restTemplate.postForObject(this.SERVICE_FEATURE_URL + "/query", entity, String.class);
Here instead of getting the result as a String object, is it possible to get the data as an ArcGIS Java class object?
P.S. I know how to get the arcgis-java
dependency using Maven:
<dependency>
<groupId>com.esri.arcgisruntime</groupId>
<artifactId>arcgis-java</artifactId>
<version>100.2.1</version>
</dependency>