|
POST
|
To store all results in a global array, you probably want to look at dojo deferred You would batch up the queries and run them - since they run asynchronously, you'd let the deferred manager handle the receipt of responses, which you would store in the global array. I posted a similar question on Stack Exchange a while ago - the answer there includes a code sample which may help you.
... View more
07-23-2014
10:22 PM
|
1
|
1
|
648
|
|
POST
|
Hi David, There may be a way to do this directly, but I haven't found it. Instead I listen for a click event on the map, then loop through the list of Dynamic layers and fire off the method (eg, running a query task). Steve
... View more
07-23-2014
10:08 PM
|
1
|
0
|
755
|
|
POST
|
Hi Thomas, Here's another potential approach: jquery - How to simulate a click by using x,y coordinates in JavaScript? - Stack Overflow (where the XY would be page coordinates over the map). I haven't tested this...... Steve
... View more
07-23-2014
04:44 PM
|
0
|
8
|
5449
|
|
POST
|
Great question. I have no experience with Jasmine, but I have done similar testing using Selenium. This is a great framework for simulating user input and interaction.
... View more
07-22-2014
08:16 PM
|
0
|
10
|
5449
|
|
POST
|
Hi All, Anyone know if this is an AGOL/Portal specific product or if it will be usable with standalone ArcServer? Thanks, PW I've only played with beta 1 for a few minutes, but on first glance it looks like it's hard-wired for ArcGIS Online/Portal - one of the inputs is an ArcGIS.com web map.
... View more
06-05-2014
02:54 PM
|
0
|
0
|
1358
|
|
POST
|
Thanks Jason. Could you add this information to the help file entries for SearchCursor, InsertCursor and UpdateCursor?
... View more
04-30-2014
04:49 PM
|
0
|
0
|
304
|
|
POST
|
Since a cursor outputs to either a list or a dictionary I believe you can use the len() operator on the cursor output Unfortunately I don't think that's correct. [ATTACH=CONFIG]33500[/ATTACH] I've updated my original question to say that the fact that cursor.next() crashes after the last record should be reflected in the documentation - it's clear there are lots of workarounds to this "feature". Thanks for the assistance, Steve
... View more
04-30-2014
04:37 PM
|
0
|
0
|
2224
|
|
POST
|
When I want to verify a selection was made I use code like this ("parcels" is a layer that may or may not contain a selection): if int(arcpy.GetCount_management(parcels).getOutput(0)) > 0: I guess I'd need to couple this with a Select By Attributes first, in order to ensure my whereClause was being used. But it's a good workaround - thanks.
... View more
04-30-2014
04:11 PM
|
0
|
0
|
2224
|
|
POST
|
Thanks Curtis. I'm doing something similar to handle it (maybe this is the correct method - but as you say it'd be nice if it was documented).
with arcpy.da.SearchCursor(outFC, fields, whereClause) as sCursor:
try:
#See if there are any records returned. If this throws an error, this means
#there are no records, in which case we need to add one
sRow = sCursor.next()
except:
#Create a new point in the output geodatabase
pt = (lon, lat)
iCursor.insertRow([pt, ID])
I should probably check that the error was of type StopIteration for completeness.....
... View more
04-30-2014
04:07 PM
|
0
|
0
|
2224
|
|
POST
|
Using the older arcpy.SearchCursor, the next() method would return Nothing once the last record had been passed. Using the newer arcpy.da.SearchCursor, I'm finding that the next() method crashes the script if there are no more records. To illustrate: import arcpy fc = "C:\Program Files (x86)\ArcGIS\Desktop10.2\ArcGlobeData\continent.shp" fields = ["CONTINENT"] where = "CONTINENT = 'Asia'" cursor = arcpy.da.SearchCursor(fc, fields, where) for i in range(0,5): row = cursor.next() print(row) There is only one record in the cursor, so the first time it iterates the name is printed. But the second iteration throws a StopIteration error. I believe this is a bug - the cursor should return Nothing, allowing us to handle the situation. At the very least, this behaviour should be documented. (I know there is an alternative method using for row in cursor: but my point is that the next() method should not throw an error after the last record. Also, in my case I'm looking for situations where there are no records so I can perform an action - this doesn't work when using for row in cursor:). Thanks, Steve
... View more
04-30-2014
03:40 PM
|
1
|
10
|
3391
|
|
POST
|
I'm up against a time constraint so I'm open to alternatives. Care to share @geo_james? I'm tech agnostic. By alternative, I mean a totally different approach, where I'm bringing all the datasets in-house for pre-processing rather than trying to do it "live" using ArcGIS Online. So I'm still not much help, sorry.
... View more
03-04-2014
11:45 AM
|
0
|
0
|
1164
|
|
POST
|
Hi James, Unfortunately I can't help here - I ended up using an alternative approach so I never explored it any further. Good luck, Steve
... View more
03-04-2014
11:16 AM
|
0
|
0
|
1164
|
|
POST
|
What I want is a couple buttons on my page that will run each of the tools above. But I dont want to have to click the button every time, rather click it once and that code will run on each click until the user selects the other tool. You need to set a listener which enables each function when its button is clicked, and disables the other functionality.
... View more
02-16-2014
01:33 PM
|
0
|
0
|
368
|
|
POST
|
Try something along these lines, using union to grow the extent to encompass all features:
var extent = featureSet.features[0].geometry.getExtent();
for (var i = 1; i < featureSet.features.length; i++) {
extent = extent.union(featureSet.features.geometry.getExtent());
}
... View more
02-16-2014
01:01 PM
|
2
|
0
|
2249
|
|
POST
|
The reference to �??ArcGIS for Developers�?� confuses me. The ArcGIS for Developers reference possibly refers to https://developers.arcgis.com/en/plans This allows you to sign up for a Developer license of ArcGIS Online, and doing so should allow you to deploy the ArcGIS Server JS API in your application. As Derek says, check with your local Esri rep to confirm that this is the case. Good luck, Steve
... View more
01-21-2014
06:13 PM
|
0
|
0
|
1639
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 11-17-2014 08:45 PM | |
| 1 | 03-15-2011 04:23 PM | |
| 1 | 10-18-2019 12:50 AM | |
| 3 | 01-22-2019 02:33 PM | |
| 1 | 09-26-2011 10:36 PM |
| Online Status |
Offline
|
| Date Last Visited |
10-20-2022
12:19 AM
|