|
POST
|
The Basic Viewer template allows you to search a layer as well as geocoders. You can select any of the layers in your map and select the fields you would like to be searched, enable suggestions (up to 15) and select the default layer to be searched if you select more than one searchable layer. You can also select your geocoding service here and uncheck the World Geocoder (I think). One issue I have encountered is if your search layers have a visibility set that isn't visible when the app opens, if you type in a search and select one of the suggestions it gives an error. A bug has been logged by tech support for that issue, but I can't find a link for it outside My Esri.
... View more
05-17-2016
01:57 PM
|
1
|
2
|
5683
|
|
POST
|
In some app templates you can configure a search tool to default to your geocoder instead of the World Geocoder. You can also have it search a field in a layer. Sometimes I have the search tool search my address point layer instead of a geocoder, this way I can enable suggestions and a list of valid addresses is displayed for the user.
... View more
05-17-2016
07:20 AM
|
1
|
5
|
5683
|
|
POST
|
You can go to My Organization -> Edit Settings > Utitlity Services. In the Geocoding section delete the ESRI World Geocoder. It won't let you do this unless you have another geocoding service from ArcGIS Server present.
... View more
05-16-2016
03:13 PM
|
2
|
0
|
5682
|
|
POST
|
My advice is never use the "Create Layer From Selected Features" option. It is really just a pointer to the whole dataset. It's easier to export the selected features to their own layer, that way you always have it. File storage is cheap and you cna then have a permanent copy instead of a selection set of the whole dataset. We had an employee that used selection layers all of the time and now her maps are worthless to the person who took her place.
... View more
03-30-2016
03:27 PM
|
0
|
0
|
710
|
|
POST
|
Sorry Khaled HassenI should have read your reply more thoroughly. I tacked the token on the end of my url using: replicaUrl = crJson['URL'] + '&token=' + token
urllib.urlretrieve(replicaUrl, 'myLayer.json') And again I get html code in myLayer.json, but this time it looks like this: Am I not adding the token correctly?
... View more
03-30-2016
09:13 AM
|
0
|
0
|
3275
|
|
POST
|
Jake, Thanks for the input. It looks like you have done what I am trying to do, but I think the code you use for the attachments is the same code I am trying to use in my script (line 286 in your code is where I hit my problem). So it is running into the same problem I am having. I was able to run your tool successfully but it said there were no attachments when there are. Khaled Hassen mentioned above that with the recent ArcGIS Online update there is another token required to get the json that contains the data. I'm not sure how to go about submitting that token to get at the json, I'm a newbie at the REST API and web requests. Any other thoughts?
... View more
03-29-2016
03:33 PM
|
0
|
0
|
3275
|
|
POST
|
I was actually thinking this as I was driving home last night. So I need to get another token for the url to the json file (replicaUrl in my code)?
... View more
03-29-2016
12:25 PM
|
0
|
0
|
3275
|
|
POST
|
Fred Spataro, got any ideas? You asked me in my earlier question if I could just use the Export Item method, but I need the attachments and didn't see any parameters to include attachments with Export Item.
... View more
03-28-2016
03:16 PM
|
0
|
1
|
3275
|
|
POST
|
I am trying to get this script to work for an application for one of our departments. If you look at the comment by stuartalexandersanders in the GitHub link - that is the same error I am getting. I'm hoping Alex Sanders is the same person and has fixed it? gtUrl = 'https://www.arcgis.com/sharing/rest/generateToken'
gtValues = {'username' : 'MyUsername',
'password' : 'MyPassword',
'referer' : 'http://www.arcgis.com',
'f' : 'json' }
gtData = urllib.urlencode(gtValues)
gtRequest = urllib2.Request(gtUrl, gtData)
gtResponse = urllib2.urlopen(gtRequest)
gtJson = json.load(gtResponse)
token = gtJson['token']
### Create Replica ###
### Update service url HERE ###
crUrl = 'http://services2.arcgis.com/MyServices/arcgis/rest/services/MyServicName/FeatureServer/createReplica' That code works and I am able to get a token for the feature service. This next block is where I am having my trouble - crValues = {'f' : 'json',
'layers' : '0',
'returnAttachments' : 'true',
'token' : token }
crData = urllib.urlencode(crValues)
crRequest = urllib2.Request(crUrl, crData)
crResponse = urllib2.urlopen(crRequest)
crJson = json.load(crResponse)
replicaUrl = crJson['URL']
urllib.urlretrieve(replicaUrl, 'myLayer.json') The error I get is from the urlretrieve call. myLayer.json is not a json file but an html file that says "Token Required". The error text in python is: Any ideas why this would happen? Apparently it was working for Alex before the update to ArcGIS Online earlier this month. Thanks, Jeff
... View more
03-28-2016
03:13 PM
|
0
|
10
|
8187
|
|
POST
|
You were right Fred. I had failed to include the createReplica method at the end of my url. I am now able to get the URL key from the json response. But now I am running into another error that I will post in another question. Thanks for your help.
... View more
03-28-2016
01:41 PM
|
0
|
0
|
3028
|
|
POST
|
Fred, I think you are right. I just copied my url from my layer and didn't see I needed the CreateReplica. I will have to look into this on Monday. Thanks so much for your help.
... View more
03-25-2016
02:59 PM
|
0
|
0
|
3028
|
|
POST
|
I think my token is valid, when I run the same code in IDLE interactively I print out the token and it gives a long string with an expiration if I remember correctly. I also get a very large dictionary in my crJson variable, but 'URL' is not among the keys.
... View more
03-25-2016
12:27 PM
|
0
|
0
|
3028
|
|
POST
|
Yes, I listed the keys in the crJson dictionary in my original post and 'URL' wasn't among them.
... View more
03-25-2016
12:23 PM
|
0
|
0
|
3028
|
|
POST
|
I am trying to replicate a hosted feature service in a local file geodatabase to do some local analysis. I have found this code on GitHub that I have been trying to use. I set it up according to the instructions and I get a KeyError on line 9 below: crValues = {'f' : 'json',
'layers' : '0',
'returnAttachments' : 'true',
'token' : token }
crData = urllib.urlencode(crValues)
crRequest = urllib2.Request(crUrl, crData)
crResponse = urllib2.urlopen(crRequest)
crJson = json.load(crResponse)
replicaUrl = crJson['URL']
urllib.urlretrieve(replicaUrl, 'myLayer.json') Error screenshot: I was able to run all of the commands in the IDLE interactive window successfully and check the results of each command. There is no 'URL' key in the crJson dictionary. Here are a list of the keys that are: [u'supportsCalculate', u'editingInfo', u'typeIdField', u'supportsValidateSql', u'advancedQueryCapabilities', u'supportsCoordinatesQuantization', u'supportsRollbackOnFailureParameter', u'allowGeometryUpdates', u'globalIdField', u'supportsAdvancedQueries', u'id', u'relationships', u'drawingInfo', u'capabilities', u'indexes', u'currentVersion', u'geometryType', u'hasStaticData', u'type', u'useStandardizedQueries', u'supportedQueryFormats', u'isDataVersioned', u'supportsAttachmentsByUploadId', u'supportsApplyEditsWithGlobalIds', u'description', u'standardMaxRecordCount', u'defaultVisibility', u'extent', u'objectIdField', u'tileMaxRecordCount', u'htmlPopupType', u'types', u'hasM', u'displayField', u'name', u'templates', u'supportsStatistics', u'hasAttachments', u'fields', u'maxScale', u'copyrightText', u'hasZ', u'maxRecordCount', u'minScale', u'maxRecordCountFactor', u'editFieldsInfo', u'serviceItemId'] The code is over two years old, have there been changes to the way requests are handled? Any thoughts? Many thanks.
... View more
03-24-2016
09:52 AM
|
0
|
8
|
5810
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 10-07-2011 12:55 PM | |
| 1 | 01-13-2021 11:29 AM | |
| 2 | 06-05-2024 07:29 AM | |
| 1 | 04-26-2024 11:42 AM | |
| 1 | 02-12-2024 07:49 AM |
| Online Status |
Offline
|
| Date Last Visited |
10-30-2025
12:56 PM
|