POST
|
Just an update. I did get the Upload and Add Raster operators working with the ArcGIS Server 10.1 REST API. On the server I have an Image Mosiac dataset exposed as an Image Service. I'm using STK Server to generate a custom raster for me in .jp2 format. The raster is saved to a temp directory on the server, and then I invoke the Upload then Add Raster operators which then publishes the raster to the server and makes it immediately available through the Image Service. It works great! Here is a snippet that does the Add Raster operation: public string AddRasterToArcGISServer(string ArcGISImageServerURL, string RasterItemID) { Uri address = new Uri(ArcGISImageServerURL + "/add"); // Create the web request HttpWebRequest request = WebRequest.Create(address) as HttpWebRequest; // Set type to POST request.Method = "POST"; request.ContentType = "application/x-www-form-urlencoded"; // Create the data we want to send string itemIds = RasterItemID; string rasterType = "Raster Dataset"; StringBuilder data = new StringBuilder(); data.Append("itemIds=" + HttpUtility.UrlEncode(itemIds)); data.Append("&rasterType=" + HttpUtility.UrlEncode(rasterType)); // Create a byte array of the data we want to send byte[] byteData = UTF8Encoding.UTF8.GetBytes(data.ToString()); // Set the content length in the request headers request.ContentLength = byteData.Length; // Write data using (Stream postStream = request.GetRequestStream()) { postStream.Write(byteData, 0, byteData.Length); } string functionResponse = ""; // Get response using (HttpWebResponse response = request.GetResponse() as HttpWebResponse) { // Get the response stream StreamReader reader = new StreamReader(response.GetResponseStream()); // Console application output functionResponse = reader.ReadToEnd(); } return functionResponse; }
... View more
11-01-2012
09:56 AM
|
0
|
0
|
488
|
POST
|
Thanks! Ok - so the basic workflow is to manually copy the raster somewhere to the server (the registered directory) and then run the add raster operation to add it to the Image Service? I will try that out and let you know how I make out. I'm just looking for the basic workflow to make sure I'm using the 10.1 capabilities appropriately.
... View more
10-23-2012
09:41 AM
|
0
|
0
|
488
|
POST
|
After looking at the resources page - I'm looking for a basic example of how to upload a raster to my image service. I'm able to do this fine through the generic web GUI (http://<service-uploads-url>/upload), but I'm looking to do this dynamically in my custom javascript web app. I figure there is a simple REST URL that I can construct. However, I don't see any parameter where I can define the source location of my raster that is to be uploaded to the server.
... View more
10-22-2012
12:15 PM
|
0
|
3
|
2926
|
POST
|
Ok - got it working now. I just backed off my complex REST call to a more simplified call. Maybe one of the parameters is now updated in 10.1. Regardless, it works now. var imageServiceLayer = new esri.layers.ArcGISImageServiceLayer("http://<my server name>/arcgis/rest/services/RCS/ImageServer/" + imageObjectID + "/image?bbox=-117.86107846499999,33.215995932000055,-117.35430291299997,33.62007476500003", { "opacity": .50 }); map.addLayer(imageServiceLayer);
... View more
07-03-2012
07:31 AM
|
0
|
0
|
154
|
POST
|
Hey Everyone, I have a javascript api web app that queries an served image mosaic dataset, and returns the appropriate raster to the web map. I just upgraded from 10.0 to 10.1 and am not able to get the raster added to the map. The raster is queried fine, the .png is created in the arcgisoutput folder, but never added to the map. Are there additional security or user permission items that I need to pay attention to with 10.1? The debugger in Chrome & IE aren't very helpful.
... View more
07-03-2012
06:07 AM
|
0
|
1
|
649
|
POST
|
Make sure your path is correct - my local path looks like "http://<my server>/arcgis_js_api/library/2.8/jsapi/"
... View more
04-26-2012
07:16 AM
|
0
|
0
|
455
|
POST
|
I need to query my Image Service to find the appropriate rasterDataSet to add to my map. To do this, I am currently making 2 sequential calls to my image service: The 1st call is to query the service to get to appropriate ObjectID of my raster dataset (where Name='someFileName') The 2nd call is to get the image Is there anyway I can do the query and return the image all in 1 REST call? Here is my code snippet:
$.getJSON(
"http://<my server name>/ArcGIS/rest/services/<my image service name>/ImageServer/query?objectIds=&where=Name%3D%27" + fileName + "%27&returnGeometry=false&returnIdsOnly=true&f=pjson&callback=?",
function(Object)
{
imageObjectID = Object.objectIds[0];
for (var j = 0, jl = map.layerIds.length; j < jl; j++) {
var currentLayer = map.getLayer(map.layerIds );
if (currentLayer.declaredClass == "esri.layers.ArcGISImageServiceLayer") {
map.removeLayer(currentLayer);
}
}
if(typeof imageObjectID != 'undefined')
{
var imageServiceLayer = new esri.layers.ArcGISImageServiceLayer("http://<my server name>/ArcGIS/rest/services/<my image service name>/ImageServer/" + imageObjectID + "/image?bbox=-<SomeBoundingBox>&format=png&pixelType=U8&noData=noData%3D0&interpolation=RSP_BilinearInterpolation", { "opacity": .50 });
map.addLayer(imageServiceLayer);
}
}
);
... View more
04-17-2012
09:14 AM
|
0
|
0
|
790
|
POST
|
that was easy... I just constructed a REST call to my image service with the appropriate parameters. I am getting a strange darkening of my base map image however.
... View more
04-16-2012
01:33 PM
|
0
|
1
|
483
|
POST
|
I created a large mosaic image service using ArcGIS Server 10. I'm looking for a javascript API example to select and render individual rasters datasets from that mosaic. I see the REST API for the service, but thought there might be an easy way to integrate this into my existing javascript client.
... View more
04-16-2012
01:23 PM
|
0
|
5
|
967
|
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:24 AM
|