POST
|
@MarkBaird sorry for the lack of clarity. I guess I am not sure but I am open to both options. Essentially I would like to build a webapp with java on the backend that can do GET and POST against a published service on an ArcGIS Server to query, edit features, and grab attachments from those published services and also be able to commit attachments and general feature data into a db such as oracle or postgres
... View more
09-17-2021
07:35 AM
|
0
|
1
|
1867
|
POST
|
Hi Mark! Thanks for the reply. This does help and it seems I have been using an outdated ArcGIS WebService Engine Runtime, and not the Java SDK. That being said, would this wrapped REST API allow me to work with published feature layers on an ArcGIS Server? Also, I hate to be so needy but could you link me to examples of the Java API that wraps the REST API? I have checked in the github link you provided for examples and I can't seem to find examples for making GET requests/queries against a map service
... View more
09-17-2021
06:43 AM
|
0
|
0
|
1869
|
POST
|
IS there any functionality in the Java SDK that allows for interactions on a REST? For instance, I am trying to access the attachments on a published service or just pull general information about the table or layer. I found that there is MapServerBindingStub but those functions appear to be for SOAP only. Currently I am doing this through custom code by getting JSON requests and parsing those, which is fine, but I want to make sure I am not missing anything in the API that I could be using instead to make things easier.
... View more
09-16-2021
05:26 PM
|
0
|
6
|
1904
|
POST
|
At the moment, you can see that I am just trying to update the definition. I tried something simple like minScale. Eventually I Would like to create a feature service using JSON and POST
... View more
07-14-2018
03:04 PM
|
0
|
0
|
944
|
POST
|
I've worked with ajax requests before, but I'm trying to make changes to a Feature Service using updateDefintion but I can't seem to get it to work. For debugging purposes, I've modified this example: Request data from a remote server | ArcGIS API for JavaScript 4.8 I'm able to plug in the Feature Service to properly get a response using GET, but when trying to use a FormData to load JSON as the payload for updateDefinition, I don't get a response. I modified a small amount of data to effectively try to use something simple as: var item = { "minScale" : 10, "maxScale" : 0 }; var formData = new FormData(); for ( var key in item ) { formData.append(key, item[key]); }; // Make the request on a button click using the // value of the 'input' text. on(btnQuery, "click", function() { console.log('POSTing....') var url = input.value; esriRequest(url, { responseType: "json", method: "post", body: formData }).then(function(response) { console.log('response', response); var responseJSON = JSON.stringify(response, null, 2); resultsDiv.innerHTML = responseJSON; Essentially, just taking the 'item' JSON and converting it to FormData and then using FormData as the payload. Additonally, the URL that isbeing used is of the format: https://server.domain.com/arcgis/rest/services/HM/Production/FeatureServer/0/updateDefinition Here, I am simply appending 'updateDefiniton' as the method to use for modifying the service, as documented here: Update Definition (Feature Layer)—ArcGIS REST API: Services Directory | ArcGIS for Developers I don't get any errors, and there are obviously no changes being made. Do I need to adjust any settings onthe Feature Service itself? Am I missing something?
... View more
07-14-2018
11:36 AM
|
0
|
2
|
1730
|
POST
|
Steve, have you had experience using the JSON to KML?
... View more
08-28-2017
09:38 AM
|
0
|
1
|
1869
|
POST
|
Awesome! This is probably a more practical solution
... View more
08-28-2017
09:25 AM
|
0
|
0
|
1869
|
POST
|
Thanks for your reply. Specifically, I do want to download user-drawn graphics that are stored in a graphics array in javascript to a local file. However, i would like them in a useable format, such as a SHP file. Is there a way to convert the .json to a format such as SHP? I know that there is an "Export Data" widget but that is only for hosted feature layers.
... View more
08-28-2017
08:20 AM
|
0
|
2
|
1869
|
POST
|
I've looked everywhere for ways to to download user-drawn graphics using ArcGIS JS API but have not found a solution. Is this something that can at least be done using a GP task?
... View more
08-21-2017
10:13 AM
|
0
|
10
|
3341
|
POST
|
Pretty straight forward: I am simply trying to get a feature layer var floodLayer = new FeatureLayer("URL"); and convert it to a polygon array similar to: var polygons = []; for (var i = 0; i < floodLayer.graphics.length; i++) { var polygons = new Polygon({ "rings": floodLayer.graphics.rings, "spatialReference": floodLayer.graphics.spatialReference }); } However, feature layers don't appear to have the appropriate properties to create polygons. Unless I am missing something?
... View more
02-13-2017
11:45 AM
|
0
|
1
|
925
|
POST
|
I actually figured it out. I simply did a simple logical statement: if (select.contains(feature.geometry) && polygon.contains(feature.geometry)) { floodCalcs.businessF += 1; } My only issue now is totally different. Is there a way to convert a feature layer (of polygons) to an array of polygons?
... View more
02-13-2017
11:39 AM
|
0
|
0
|
455
|
POST
|
Essentially, I'm trying to perform a second spatial query on a set of returned results from a previous query. The source runs, but it doesn't return any results for floodCalcs.business in the second for-loop. I do not get any errors from this and I do check to make sure that polygons have been loaded into polygons. Just realized I don;t know how to insert formatted code in here. Help? queryShapes = function () { for (var v = 0; v < shapes.length; v++) { query = new Query(); select = shapes ; query.geometry = shapes .getExtent(); query.returnGeometry = true; businessLayer.queryFeatures(query, selectBusiness); //featureLayer.queryFeatures(query, selectInBuffer); //perform query on business layer using user drawn shape's bounding box (extent) function selectBusiness(response) { var feature; var features = response.features; var floodFeatures = []; var floodFeature; var inBuffer = []; var floodBuffer = []; var q = new Query(); q.geometry = shapes .getExtent(); q.where = "1=1"; q.outSpatialReference = map.spatialReference; q.outFields = ["*"]; q.returnGeometry = true; var qTask = new QueryTask("url"); qTask.execute(q); qTask.on("complete", queryBlock); //query flood layer using user drawn shapes and cast the returned features as polygons function queryBlock(f) { for (var i = 0; i < f.featureSet.features.length; i++) { polygons.push(new Polygon({ "rings": f.featureSet.features.geometry.rings, "spatialReference": f.featureSet.features.geometry.spatialReference })); } } //filter out features that are not actually in buffer, since we got all points in the buffer's bounding box for (var c = 0; c < features.length; c++) { feature = features ; if (shapes .contains(feature.geometry)) { inBuffer.push(feature.attributes[businessLayer.objectIdField]); } //use flood polygons that were returned in queryBlock function to find points in flood zones for (var b = 0; b < polygons.length; b++) { var poly = polygons; if (poly.contains(feature.geometry)) { floodCalcs.businessF += 1; } } } var subQuery = new Query(); subQuery.objectIds = inBuffer; //use a fast objectIds selection query (should not need to go to the server) featureLayer.selectFeatures(subQuery, FeatureLayer.SELECTION_NEW, function (results) { floodCalcs.business += sumPopulation(results); }); } function sumPopulation(features) { var popTotal = 0; popTotal = features.length; return popTotal; } } }
... View more
02-12-2017
09:08 PM
|
0
|
2
|
1016
|
Online Status |
Offline
|
Date Last Visited |
2 weeks ago
|