|
POST
|
Peter, Can you elaborate on how this helps you schedule scripts? Adam Messer
... View more
02-17-2016
12:45 PM
|
0
|
4
|
2247
|
|
POST
|
Here are some things that work well for us: Use subversion control. We have 7 gis programmer/analysts and this is the allows us to track changes over time and make updates locally without affecting others. We use our own internal subversion, but github would work as well. Within our subversion repository, we maintain 5 types of python code: general functions and classes that can be used by other script and toolboxes. We add the path to this folder to our 'path' environmental variable so we can import modules from it without jumping through too many hoops Scripts. These are just stand alone python scripts that might be for one time use or a work in progress Python toolboxes: We build most of our data manager and user tools into 'pyt' files so they can be run using the ArcGIS interface. Geoprocessing services: we store the source code for publish geoprocessing services here Automated tasks: scripts that are scheduled to run on a nightly or weekly basis Code development generally occurs in standalone scripts or toolboxes. When we see an opportunity to capitalize on a function or a tool we've developed, we move it into one of the classes in the general functions folder. Been working great for us!
... View more
02-11-2016
10:29 AM
|
1
|
0
|
2248
|
|
POST
|
It's a good thought. I'm trying my best to stick with geodatabase functionality so that I run into problems down the road if we decide to use versioning or replication. Looks like I'm stuck with creating relationship classes by hand for now.
... View more
02-09-2016
02:22 PM
|
0
|
0
|
1619
|
|
POST
|
I thought about that too. But I’m trying to set up a cross-platform (ArcMap and Web) editing work flow. I don’t want the users to maintain the key fields.
... View more
02-09-2016
11:19 AM
|
0
|
2
|
1619
|
|
POST
|
Yeah...the public . Internally, we have some users that have the problem and others that don't. I suspect the same is true for the public.
... View more
02-03-2016
11:29 AM
|
0
|
0
|
1033
|
|
POST
|
Thanks Rebecca. That helps for users that call, but not when they get to a blank page and give up. It still seems like this needs to be fixed on ESRI’s end.
... View more
02-03-2016
11:13 AM
|
0
|
2
|
1033
|
|
POST
|
I have several users who can't seem to access our AGOL organization account on IE11. Other users can get to it just fine. The difference appears to be associated with security settings. The path to our AGOL site is http://mtfwp.maps.arcgis.com. Other organization pages behave the same way: http://fema.maps.arcgis.com/ http://fema.maps.arcgis.com/ http://launceston.maps.arcgis.com/ http://uplan.maps.arcgis.com/ When the problem occurs, the page just comes up blank with no indication of the problem. I was able to track down the fail point using the developer tools. The "Access is denied" error stops the rest of the script from running. The script that fails is http://cdn.arcgis.com/cdn/xxxx/js/arcgisonline/base.js. When users call and report the problem, I have been telling them to add *.arcgis.com to their list of trusted sites. But...it seems like the problem really needs to be fixed on the ESRI side, by putting the check for localStorage inside a try/catch. Anyone from ESRI (Courtney Claessens, Daniel Fenton) willing to chime in?
... View more
02-03-2016
10:52 AM
|
1
|
5
|
2302
|
|
POST
|
I use a script to publish as well. What I shared was just a piece from the end of my script. We have been publishing this way for a couple of years. Works great. It takes a while to set up, but is well worth it in the end. Our GIS analysts use python toolboxes we developed to publish/update services on our test server. After some initial testing, the GIS manager uses other tools in the same toolset to migrate the changes to production. Everything is validated and logged, which make tracking down bugs pretty easy.
... View more
01-26-2016
03:42 PM
|
1
|
1
|
361
|
|
POST
|
myList = []
item = ''
#Create name list
item = None
while item <> '':
item = raw_input("Please enter a name or blank to quit: ")
myList.append(item)
print myList You need to ask for a new input on each iteration of the loop.
... View more
01-26-2016
01:41 PM
|
1
|
2
|
768
|
|
POST
|
If you're using the time slider, then the date must be a field in the service layer. You could add a definition query to the service layer and include or exclude it by comparing it to the current date.
... View more
01-26-2016
10:23 AM
|
0
|
0
|
583
|
|
POST
|
Here is a code sample demonstrating how to update service parameters after the service has been published.
#modify these to match your environment
serverHost = 'yourgisServer.com'
serverPort = 6080
serviceRelativePath = r'/services/serviceFolder/serviceName.MapServer'
username = 'yourAdminName'
password = 'yourAdminPW'
# properites you would like to apply to the service
newProperties = {
"minInstancesPerNode": 1,
"maxInstancesPerNode": 5,
"properties": {
"enableDynamicLayers": "true",
"dynamicDataWorkspaces": "[{\"id\":\"wsName\",\"workspaceFactory\":\"SDE\",\"lockVersion\":\"false\",\"workspaceConnection\":\"connectionProps\"}]"
}
}
import json
import urllib
import httplib
# ####################
# helper functions
# ####################
def getUpdatedDict(inDict,modDict):
def _getPathsAndValuesFromModDict(d,parentDict):
for k, v in d.iteritems():
if isinstance(v, dict):
_getPathsAndValuesFromModDict(v,parentDict )
else:
parentDict = v
_getPathsAndValuesFromModDict(modDict,inDict)
return inDict
def adminApiCall(strAdminApiUrl,objParams):
def _getToken():
tokenURL = "/arcgis/admin/generateToken"
params = urllib.urlencode({'username': username, 'password': password, 'client': 'requestip', 'f': 'json'})
headers = {"Content-type": "application/x-www-form-urlencoded", "Accept": "text/plain"}
httpConn = httplib.HTTPConnection(serverHost, serverPort)
httpConn.request("POST", tokenURL, params, headers)
response = httpConn.getresponse()
if (response.status != 200):
httpConn.close()
return
else:
data = response.read()
httpConn.close()
# Check that data returned is not an error object
if not _assertJsonSuccess(data):
return
# Extract the toke from it
token = json.loads(data)
return token['token']
def _assertJsonSuccess(data):
obj = json.loads(data)
if 'status' in obj and obj['status'] == "error":
#print "Error: JSON object returns an error. " + str(obj)
return False
else:
return True
token = _getToken()
if objParams:
objParams['token'] = token
objParams['f'] = 'json'
else:
objParams = {'token': token,'f': 'json'}
params = urllib.urlencode(objParams)
headers = {"Content-type": "application/x-www-form-urlencoded", "Accept": "text/plain"}
# Connect to URL and post parameters
httpConn = httplib.HTTPConnection(serverHost, serverPort)
httpConn.request("POST", r'/arcgis/admin'+ strAdminApiUrl, params, headers)
# Read response
response = httpConn.getresponse()
if (response.status != 200):
print response.status
httpConn.close()
output = "Error: Code "+str(response.status)+', '+str(response.reason)
else:
data = response.read()
# Check that data returned is not an error object
if not _assertJsonSuccess(data):
obj = json.loads(data)
output = obj['messages']
else:
dataObj = json.loads(data)
output = dataObj
httpConn.close()
try:
if output[0] == u'Authorization failed. This user account does not have the required privileges to access this application.':
return {'status':'error','msg':u'Authorization failed for user'}
except:
return output
# ####################
# end helper functions
# ####################
#fetch the parameters using the admin api
serviceInfo = adminApiCall(serviceRelativePath,{'f':'json'})
#update new parameters using the new properties
serviceInfo = getUpdatedDict(serviceInfo,newProperties)
#apply the updated params
adminApiCall('/services/test/testForDave.MapServer/edit',{'f':'json','service':json.dumps(serviceInfo)}) Modifying properties after the service is published is, in my opinion, easier than doing so via the sd or sddraft.
... View more
01-26-2016
08:59 AM
|
1
|
4
|
2167
|
|
POST
|
.mxd --> .sddraft --> .sd --> Service We're at 10.1 SP1, and the work flow is the same. .mxd --> .sddraft --> .sd --> Service. Regardless, what I'm suggest occurs after the service is published. I will see if I can scrape together a sample script.
... View more
01-26-2016
08:11 AM
|
0
|
0
|
2167
|
|
POST
|
BTW, our server is still at 10.1, but I don't see any reason why it wouldn't apply to 10.3.
... View more
01-25-2016
12:45 PM
|
0
|
4
|
2167
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 04-21-2017 10:00 AM | |
| 1 | 09-11-2015 08:24 AM | |
| 1 | 01-25-2016 12:30 PM | |
| 1 | 05-27-2015 08:12 AM | |
| 1 | 06-09-2015 03:28 PM |
| Online Status |
Offline
|
| Date Last Visited |
11-11-2020
02:23 AM
|