|
POST
|
I don't think this is possible solely within the REST API. Your original REST API query will return a featureset object, each feature within the featureset will have a geometry. However, the REST API does not seem to have any functions to get the extent of all feature geometries. This type of function is normally carried out by the client application. For example in the ESRI JS API you can use the client-side graphicsutils.graphicsExtent() method to get the extent of an array of graphics.
... View more
12-09-2014
01:42 PM
|
0
|
7
|
3637
|
|
POST
|
Why not just include the two original fields in the DBF as well as the concatenated ID value? If you have to do this in Excel you can use formulas: A B C 1 ExRock RockType1 RockType2 2 Andesite_Basalt Andesite Basalt 3 Basalt_Granite Basalt Granite ROCKTYPE1 =LEFT(A2,(FIND("_",A2) - 1)) ROCKTYPE2 =RIGHT(A2, LEN(A2) - FIND("_",A2)) Otherwise, if you are processing this within python then use split('_") as Kevin suggests.
... View more
12-09-2014
01:24 PM
|
1
|
0
|
2479
|
|
POST
|
If you use an IdentifyTask to get the feature then you can access the feature attributes within the callback function. I have created an example of this (based on an ESRI sample). The example just displays an attribute value in an alert but you could pass this to your report creation function. Basically, you access the IdentifyTask response features array and then get an attribute value from the feature: ...
var deferred = identifyTask
.execute(identifyParams)
.addCallback(function (response) {
// response is an array of identify result objects
// Let's return an array of features.
// Check the Google Chrome Developer Tools console output:
console.log("Identify Response: ", response);
// this is how you can access feature attributes:
alert(response[0].feature.attributes['Parcel Identification Number'])
... As noted in the code try using Google Developer Tools to log the object to the console and you can view its properties:
... View more
12-07-2014
07:33 PM
|
1
|
1
|
2352
|
|
POST
|
EDIT: ?? - GeoNet was showing this with no answers until after I posted this. Not sure why but hope this helps anyway. Check the source code in this sample. Basically the sample takes a map click event and then creates 4 identify tasks 200m in each direction from the map click point. ...
// Create multiple identify target points
pts = [];
pts.push(event.mapPoint.offset(0, 200));
pts.push(event.mapPoint.offset(200, 0));
pts.push(event.mapPoint.offset(0, -200));
pts.push(event.mapPoint.offset(-200, 0));
console.log(pts);
// Create multiple identify tasks
var tasks = [];
for (var i=0;i<pts.length;i++){
tasks.push(singleIdentifyTask(pts))
}
...
// this returns a single task (deferred)
function singleIdentifyTask(pt){
console.log("Creating Identify Task: ", pt);
identifyParams.geometry = pt;
return identifyTask.execute(identifyParams);
} The code then runs the tasks within dojo/promise/all and processes the results when all tasks are completed: // Run tasks
console.log("Running Tasks");
all(tasks).then(function(taskResults){
map.graphics.clear();
for (var i=0;i<pts.length;i++){
map.graphics.add(new Graphic(pts, sms));
}
// results will be an Array
console.log("Results", taskResults);
// example: add each result to map
for (var i=0;i<taskResults.length;i++){
var taskResult = taskResults;
for (var j=0;j<taskResult.length;j++){
console.log(taskResult );
map.graphics.add(new Graphic(taskResult .feature.geometry, sfs));
}
}
// show identify points on map
for (var i=0;i<pts.length;i++){
map.graphics.add(new Graphic(pts, sms));
}
}); I have placed console.log statements so you can open a developer console and view the objects as they are being created or used. Hope this helps. Owen - SpatialXP
... View more
12-02-2014
02:28 PM
|
1
|
0
|
2677
|
|
POST
|
Check out the AddMessage function in arcpy: ArcGIS Help 10.1 Before you return your user count you could modify the print statements to this: if total_users > 0:
arcpy.AddWarning("Total number of connected users " + str(total_users))
else:
arcpy.AddMessage("No users connected")
... View more
11-24-2014
06:52 PM
|
2
|
2
|
2508
|
|
POST
|
I haven't used ArcObjects via Java but I would be very surprised if the FeatureBuffer had not been implemented.
... View more
11-23-2014
10:06 PM
|
0
|
0
|
2724
|
|
POST
|
In ArcMap: Create a STATEFIPS field (Text with a length of 2) in your layer. Select your States and assign the State component of the FIPS code. Create new field (Text with a length of 5) for example FINALFIPS. Use the Field Calculator to concatenate the values: [STATEFIPS] + [FIPSVALUES] Assuming that FIPSVALUES is the name of your 3 character county FIPS code field.
... View more
11-23-2014
09:54 PM
|
1
|
1
|
1604
|
|
POST
|
Did you end up getting a reduction in your total processing time?
... View more
11-21-2014
12:20 PM
|
0
|
2
|
2724
|
|
POST
|
There is a syntax error on the line that is throwing the error. However, you don't need to wrap the layer drawing options code in a function - my example was just taken from the ESRI documentation.
// start measurement tool - the current layer we are measuring is the operational layer
// error follows this line
// function (LayerDrawingOptions, SimpleRenderer) { <-- Remove this line
var layerDrawingOptions = [];
var layerDrawingOption = new LayerDrawingOptions();
var sfs = new SimpleFillSymbol(
"solid",
new SimpleLineSymbol("solid", new Color([195, 176, 23]), 2),
null
);
// } <-- Remove function closure
layerDrawingOption.renderer = new SimpleRenderer(sfs);
// The dynamicData object does not exist in your code - it is from the ESRI sample:
//dynamicData.setLayerDrawingOptions(layerDrawingOptions);
operationalLayer.setLayerDrawingOptions(layerDrawingOptions);
There still appear to be some issues with the measure functionality.
... View more
11-20-2014
11:50 AM
|
2
|
1
|
2129
|
|
POST
|
Your operationalLayer is an ArcGISDynamicMapServiceLayer and this object does not have a setRenderer() method. You should use the setLayerDrawingOptions() method instead:
require([
"esri/layers/LayerDrawingOptions", "esri/renderers/SimpleRenderer", ...
], function(LayerDrawingOptions, SimpleRenderer, ... ) {
var layerDrawingOptions = [];
var layerDrawingOption = new LayerDrawingOptions();
var sfs = new SimpleFillSymbol(
"solid",
new SimpleLineSymbol("solid", new Color([195, 176, 23]), 2),
null
);
layerDrawingOption.renderer = new SimpleRenderer(sfs);
// change 1 to the layer index that you want to modify:
layerDrawingOptions[1] = layerDrawingOption;
dynamicData.setLayerDrawingOptions(layerDrawingOptions);
...
});
... View more
11-19-2014
02:35 PM
|
0
|
3
|
2129
|
|
POST
|
The simplest solution would be to change the projection of your ArcMap document and calculate the XY coordinates. Go to your map document Data Frame Properties and select the Coordinate System tab. Search for 'web mercator' or browse to: Projected Coordinate Systems > World > WGS1984 Web Mercator. Then you can use the Add XY tool to get the projected coordinates. Alternatively, if you want to be able to do this for any point dynamically in the ESRI JS API use a Geometry Service to project your coordinates.
... View more
11-18-2014
01:19 AM
|
0
|
1
|
1676
|
|
POST
|
One thing that I can see is that you should flush the feature buffer at regular intervals. You code is adding all of the features to the feature buffer and then writing them only once at the end of the function. Try flushing the buffer at regular intervals for example (pseudo code only as I am not too familiar with Java):
int i = 0;
...
for(LineInfo lineInfo:coords) {
...
cursor.insertFeature(featureBuffer);
c += 1;
if (c == 100){
// flush cursor and reset counter
cursor.flush();
c = 0;
}
}
// final flush for remaining features
cursor.flush();
...
Hope this helps.
... View more
11-17-2014
09:49 PM
|
0
|
4
|
2724
|
|
POST
|
You can do this using the optional srcNodeRef parameter when constructing the scalebar - see this example. The trick is to place a div over the map and use it as the scalebar container.
<style>
html, body { height: 100%; width: 100%; margin: 0; padding: 0; }
#map{padding:0;}
#scalebar-container{
position: absolute;
bottom: 10px;
left: 10px;
background-color: #fff;
width: 120px;
height: 30px;
z-index:1;
border: 1px solid #ccc;
padding: 10px;
border-radius: 12px;
}
</style>
…
<div id="map" data-dojo-type="dijit/layout/ContentPane"
data-dojo-props="region:'center'"
style="overflow:hidden;">
<div id="scalebar-container"></div>
</div>
…
<script>
...
// Apply the scalebar to the scalebar-container div
var container = document.getElementById('scalebar-container');
var scalebar = new Scalebar({ map: map, scalebarUnit: "dual" }, container);
...
</script>
The problem with this approach is that the width of the ESRI scalebar width is dynamic and the container does not automatically expand/contract when the scalebar size changes. This can lead to the scalebar over-running the container div. A JavaScript hack can help to get around this:
map.on("zoom-end", function(evt) {
// Get max width of child divs
var w = 0;
var esriSbDiv = container.childNodes[0];
for (var i = 0; i < esriSbDiv.childNodes.length; i++) {
if(esriSbDiv.childNodes.offsetWidth > w) {
w = esriSbDiv.childNodes.offsetWidth;
}
}
// Apply new width to scalebar container
container.setAttribute("style","width:" + (w + 40) + "px");
});
You may need to play around with the width value (+40) in the zoom-end function depending on your scalebar style.
... View more
11-15-2014
05:06 PM
|
3
|
0
|
2105
|
|
POST
|
For option A make sure to use a feature buffer when creating a feature class. Look for any ArcObjects Java documentation on IFeatureBuffer (com.esri.arcgis.geodatabase.IFeatureBuffer). I have not done this in Java but in .Net it is orders of magnitude faster. The 3 minute process will probably take several seconds using a feature buffer.
... View more
11-11-2014
02:54 AM
|
0
|
6
|
2724
|
|
POST
|
Maybe try to get in touch with Daniel Langat who performed GIS modelling for this paper: http://www.ncbi.nlm.nih.gov/pmc/articles/PMC4200235/ I don't know Daniel and am not sure how to contact him - Google is your friend.
... View more
11-11-2014
02:40 AM
|
0
|
0
|
860
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 10-07-2014 06:13 PM | |
| 1 | 08-25-2015 02:04 AM | |
| 1 | 10-07-2014 03:54 PM | |
| 1 | 08-07-2014 09:19 PM | |
| 1 | 03-04-2015 02:02 PM |
| Online Status |
Offline
|
| Date Last Visited |
07-21-2021
06:32 PM
|