|
POST
|
Thanks Robert The queryIds did the trick. In my original code I had a "extent-change" event function with a feature selection on the feature layer, but it did not work: map.on('extent-change', function(){
query = new Query()
query.spatialRelationship = Query.SPATIAL_REL_INTERSECTS;
query.geometry = map.extent;
myFeatureLayer.selectFeatures(query, FeatureLayer.SELECTION_NEW);
myFeatureTable._showSelectedRecords();
}) I then used your sample code to modify my code and it is now doing exactly what I want it to. map.on('extent-change', function(){
query = new Query()
query.spatialRelationship = Query.SPATIAL_REL_INTERSECTS;
query.geometry = map.extent;
myFeatureLayer.selectFeatures(query, FeatureLayer.SELECTION_NEW);
myFeatureLayer.queryIds(query, lang.hitch(this, function(objectIds) {
myFeatureTable.selectedRowIds = objectIds;
myFeatureTable._showSelectedRecords();
myFeatureTable._gridTitleNode.innerHTML = myFeatureLayer.name + ' (' + objectIds.length + ' Features)';
}));
})
... View more
03-16-2016
11:25 PM
|
1
|
0
|
2209
|
|
POST
|
I have a Feature Layer and a Feature Table in my map view. I would like the Feature Table to only show the records from the Feature Layer that are visible in the current map extent and not all the records or the selected feature records. I have tried to use the MODE_SELECTION with an update query on the Feature Layer, which then only shows the Feature Layer features which intersect with the current map extent, but the Feature Table is still showing all the records. Is it possible and how would you do it?
... View more
03-14-2016
10:57 PM
|
1
|
10
|
5895
|
|
POST
|
I'm working on a geoprocessing tool to export my online web application's map graphics to any other format via ArcGIS Server. I want to be able to send the geometries to the server and return a KML, Shapefile or whatever format I prefer. Since there is no standard method in the API to convert geometries to other formats, I have created my own procedure. An example of the list of geometries being sent from the web app to the server look like this with Web Mercator coordinates: [
[[2097634.02,-4008451.29],[2097514.11,-4008426.54],[2097543.19,-4008329.14],[2097671.5,-4008357.4],[2097634.02,-4008451.29]],
...
] The geometries list is built on the web app side with the following function: function exportGeometries(){
var exportGeoms = '[';
// each graphic feature geometry
for (g=0; g <= map.graphics.graphics.length - 1; g++){
exportGeoms += (g > 0 ? ',' : '');
rings = map.graphics.graphics .geometry.rings;
// each ring in the geometry
polyring = '[';
for (r=0; r <= rings.length - 1; r++){
ring = rings ;
// each point in the ring
for (pnt=0; pnt <= ring.length - 1; pnt++){
polyring += (pnt > 0 ? ',' : '');
polyring += '[' + ring[pnt][0] + ',' + ring[pnt][1] + ']';
}
}
polyring += ']';
exportGeoms += polyring;
}
exportGeoms += ']';
} The Python script tool on the server side needs to be able to read the list of geometries. Just using arcpy.GetParameter() to read the list of geometries as a list object is not sufficient, because Python receives it as a unicode object. I've found a python module (ast) that converts the unicode object to a standard list object that can be iterated in Python with a for loop to create a new feature class that can be converted: import arcpy, ast
geometries = arcpy.GetParameter(0)
geomList = ast.literal_eval(geometries)
sr = arcpy.SpatialReference(102100)
newfc = arcpy.CreateFeatureclass_management(arcpy.env.scratchWorkspace, "webgeom", "POLYGON","","","",sr)
cur = arcpy.da.InsertCursor(newfc, ("SHAPE@"))
for polyring in geometries:
array = arcpy.Array()
for p in polyring:
array.add(arcpy.Point(p[0],p[1]))
polygon = arcpy.Polygon(array,sr)
cur.insertRow([polygon])
) The new Feature Class can now be converted to any other format with the standard toolbox tools. The Python script can be integrated into the final model or script that is published as a GP service that saves the converted object on the web server and returns a URL link as output.
... View more
01-28-2016
05:25 AM
|
0
|
0
|
2302
|
|
POST
|
What errors do you get when publishing? It will probably be best to create an "intermediate" feature class in your scratch workspace as you are doing with outFCPersistent. If the output is part of a Web Service that you are updating dynamically with this script, then you don't need to create a permanent feature class.
... View more
11-18-2015
11:46 PM
|
0
|
4
|
906
|
|
POST
|
If all the rasters you want to add are in the same folder or workspace, then you can add the rasters as from Workspace and not just individual Datasets (right click on Mosaic, Add Rasters). So you can use this tool in your model (Data Management Tools -> Raster -> Mosaic Dataset -> Add Rasters to Mosaic Dataset). The tool also has options for including sub folders to browse for raster datasets as well as using an input filter in case you want to filter the rasters by name.
... View more
11-08-2015
11:01 PM
|
1
|
0
|
518
|
|
POST
|
Thanks John Gravois, luckily the print server I'm using supports CORS and setting the useCors parameter to true worked.
... View more
11-04-2015
09:48 PM
|
0
|
1
|
1331
|
|
POST
|
In the meantime I have just recreated the print request with an Ajax call, which makes it possible to perform the GP task as a POST request. Would still like to know how to use the Esri Leaflet library with POST type GP requests. jQuery Ajax $.ajax({
url:'http://myserver/arcgis/rest/services/GP_Services/ExportWebMap/GPServer/Export%20Web%20Map/execute',
type:'POST',
dataType:'json',
data:({
Format:"JPG",
Layout_Template:"A4 Landscape",
Web_Map_as_JSON:JSON.stringify(mapJSON),
f:'json'
}),
success:function(response){
console.log(response.results[0].value.url);
},
error:function(xhr, status, error) {
console.log(error);
}
}) vs Esri Leaflet GP task var printService = L.esri.GP.service({
url: "http://myserver/arcgis/rest/services/GP_Services/ExportWebMap/GPServer/Export%20Web%20Map",
async:false,
useCors:false
});
var printTask = printService.createTask();
printTask.setParam("Format", "JPG");
printTask.setParam("Layout_Template", "A4 Landscape");
printTask.setParam("f","json");
printTask.setParam("Web_Map_as_JSON",JSON.stringify(mapJSON));
printTask.setOutputParam('Output_File');
printTask.run(function(error, response, raw) {
var printout = response.Output_File.url;
console.log(printout);
});
... View more
11-04-2015
03:08 AM
|
0
|
3
|
1331
|
|
POST
|
I'm trying to send an Export Web Map request to my AGS print service with the Esri Leaflet library (ver 2.0.0 beta), but the GET request string is too long. Is it possible to run a geoprocessing task as a POST request without using a proxy page?
... View more
11-04-2015
01:50 AM
|
0
|
4
|
5334
|
|
POST
|
The WorldClim data contains long term climate parameters for the globe.
... View more
10-29-2015
02:01 AM
|
0
|
0
|
467
|
|
POST
|
ArcGIS Desktop will keep zooming in on the cache level tile between levels, unless you set your zoom scales to match that of the service cache levels. You will see that there is some pixelation between cache levels, because the layer is only cached at specified zoom levels. To change the zoom levels in ArcMap, click on the scale dropdown and select <Customize This List>. The resulting dialog box allows you to load specified zoom levels.
... View more
10-29-2015
01:56 AM
|
1
|
4
|
1210
|
|
POST
|
If you want to share it on ArcGIS Online, you've got to zip it first and then upload. Otherwise you should be able to just copy the .tbx and send/mail/share it with your colleague. What was the issue on your side?
... View more
10-28-2015
10:52 PM
|
1
|
1
|
3732
|
|
POST
|
Agreeing with Darren Wiens. First get that JPEG out of the GDB into a normal folder (export it if you have to), then you can add it to Desktop for georeferencing.
... View more
10-27-2015
10:55 PM
|
0
|
1
|
4956
|
|
POST
|
Esri suggests that you use a Geometry Service to get the feature properties, which you can then use to extend the measurement tool results.
... View more
10-26-2015
11:13 PM
|
1
|
1
|
648
|
|
POST
|
You are obviously working with a shapefile. Working with fields in shapefiles by adding a field in ArcCatalog—Help | ArcGIS for Desktop Precision—The number of digits that can be stored in a number field. For example, the number 56.78 has a precision of 4. Scale—The number of digits to the right of the decimal point in a number in a field of type float or double. For example, the number 56.78 has a scale of 2. Scale is only used for float and double field types. Increase your precision to somehing ilke 6 and set your scale to 2/3. Another good reason to work with FGDB feature classes instead.
... View more
10-25-2015
10:56 PM
|
1
|
0
|
6012
|
|
POST
|
Check with Server Manager if your "jobs" directory is now the same as it was with the previous server version.
... View more
10-22-2015
12:05 AM
|
0
|
1
|
499
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 03-22-2024 12:37 AM | |
| 1 | 10-02-2025 10:28 AM | |
| 1 | 09-17-2024 12:29 AM | |
| 1 | 03-15-2024 11:33 AM | |
| 1 | 03-13-2024 11:20 PM |
| Online Status |
Offline
|
| Date Last Visited |
yesterday
|