|
POST
|
Has anyone installed the Portal for ArcGIS solution and successfully tie it into Windows AD without requiring HTTPS? Based on the ESRI Documentation... The portal can be configured to use Integrated Windows Authentication (IWA) but that will require HTTPS (SSL) to be enabled on the Web-Adaptor/IIS server. We have many ArcGIS Server deployments which most are running just HTTP over port 80. If we enable this it appears that all services that run over HTTP port 80 will be inaccessible to the Portal for ArcGIS solution. Our security requirements on user accounts are quite extensive (12 chars, mixed case, special chars, numeric, expire 60 days, etc, etc, etc) so the BUILT-IN User store is not an adequate solution. Based on the ESRI Documentation... The portal can also be configured using LDAP. My question (s): Has Anyone tried to tie into an existing AD implementation using LDAP and Portal for ArcGIS without HTTPS being required? If so - What network traffic is being passed back and forth? I would assume some sort of token and the user name. Is that being passed via SSL, but allow non-ssl services to be registered and consumed on the interactive maps? Thanks for any feedback!
... View more
08-12-2013
01:09 PM
|
0
|
3
|
4413
|
|
POST
|
YIKES. ... having to call subprocess in 32-bit from a 64bit GP service should not be a workaround! (though that was crafty) Can you post the incident number so I can read any of the details there. I'll try to find out whats going on with this and see if I can offer up a better solution. From the notes above, nothing stands out as "incorrect". Incident #1180602
... View more
08-08-2013
11:29 AM
|
0
|
0
|
2019
|
|
POST
|
OK. I have a very hacky work around that will suffice for now. We've also submitted an incident with ESRI support. See code below: import os import arcpy from datetime import datetime ###################################### ###### Getting params ###### ###################################### input_json=arcpy.GetParameterAsText(0) ###################################### ###### Prepare workspaces ###### ###################################### dt="DATA_EXTRACT_"+datetime.today().strftime("%y%m%d_%H%M%S") ws=arcpy.env.scratchFolder json_file=os.path.join(ws,"%s.json"%dt) res=arcpy.CreateFileGDB_management(ws,dt) fgdb=res.getOutput(0) fc=os.path.join(fgdb,dt) ###################################### ###### Store JSON to file ###### ###################################### arcpy.AddMessage("Converting JSON to FC...") f=open(json_file,'w') f.write(input_json) f.close() #DOES NOT WORK FROM 64-bit... try: res=arcpy.JSONToFeatures_conversion(json_file,fc) except: arcpy.AddWarning("Could not run JSONToFeature_conversion nativly... Attempting to run in 32-bit mode...") ############################################## ###### Subprocess call to 32-bit ###### ############################################## #setup call and execute... import subprocess python=r'C:/Python27/ArcGIS10.2/python.exe' cmd="""%s -c " import sys sys.path=[] sys.path.append(r'C:\Windows\system32\python27.zip') sys.path.append(r'C:\Python27\ArcGIS10.2\DLLs') sys.path.append(r'C:\Python27\ArcGIS10.2\lib') sys.path.append(r'C:\Python27\ArcGIS10.2\lib\plat-win') sys.path.append(r'C:\Python27\ArcGIS10.2\lib\lib-tk') sys.path.append(r'C:\Python27\ArcGIS10.2') sys.path.append(r'C:\Python27\ArcGIS10.2\lib\site-packages') sys.path.append(r'C:\Program Files (x86)\ArcGIS\Desktop10.2\\bin') sys.path.append(r'C:\Program Files (x86)\ArcGIS\Desktop10.2\\arcpy') sys.path.append(r'C:\Program Files (x86)\ArcGIS\Desktop10.2\ArcToolbox\Scripts') import arcpy; res=arcpy.JSONToFeatures_conversion(%s,%s) print res.status print res.getMessages() " """%(python,"'"+json_file.replace("\\","/")+"'","'"+fc.replace("\\","/")+"'") arcpy.AddMessage("SUBPROCESS COMMAND: \n%s"%cmd) out="" try: p = subprocess.Popen(cmd, stdout=subprocess.PIPE) out, err = p.communicate() if (err!=None): arcpy.AddError("Execution failed for some reason...\n%s"%out) sys.exit() except: arcpy.AddError("Exception thrown... Not caught... ") sys.exit() #get output and check status sout=out.split("\r\n") if len(sout) >1: res_status=sout[0] res_messages="\n".join(sout[1:]) if res_status != '4': arcpy.AddError("JSONToFeatures_conversion failed...\n%s"%out) arcpy.AddError("CMD: %s"%cmd) else: arcpy.AddMessage("JSONToFeatures_converson succeeded! \n%s"%res_messages) else: sys.exit() This tries to run it as if it were to work and when an exception gets thrown it runs it in a subprocess using the 32-bit python installation. The path was still mucked with 64-bit locations so I just re-built the path with the 32-bit variables... Very hacky but this tool works from desktop (32-bit mode) and published to server (64-bit mode). If I remember to I will update if and when there is a resolution with ESRI support. Result from ArcGIS Desktop: Messages Executing: JsonToFcSubprocess "{"features": [{"geometry": {"y": 35.748388281000075, "x": -114.85761096699997}, "attributes": {"SITENAME": "MYSITE", "OBJECTID": 1}}], "fieldAliases": {"SITENAME": "SITENAME", "OBJECTID": "OBJECTID"}, "fields": [{"alias": "OBJECTID", "type": "esriFieldTypeOID", "name": "OBJECTID"}, {"alias": "SITENAME", "length": 70, "type": "esriFieldTypeString", "name": "SITENAME"}], "displayFieldName": "SITENAME", "spatialReference": {"wkid": 4269, "latestWkid": 4269}, "geometryType": "esriGeometryPoint"}" Start Time: Tue Aug 06 14:13:57 2013 Running script JsonToFcSubprocess... Converting JSON to FC... Completed script JsonToFcSubprocess... Succeeded at Tue Aug 06 14:14:01 2013 (Elapsed Time: 4.46 seconds) Result from ArcGIS Server REST endpoint: http://<SERVER>.<DOMAIN>/arcgis/rest/services/ExtractDataTools/JsonToFcSubprocess/GPServer/JSON%20To%20Feature%20Class%20subprocess/execute?Input_JSON=%7B%0D%0A+%22features%22%3A+%5B%7B%0D%0A++%22geometry%22%3A+%7B%0D%0A+++%22y%22%3A+35.748388281000075%2C%0D%0A+++%22x%22%3A+-114.85761096699997%0D%0A++%7D%2C%0D%0A++%22attributes%22%3A+%7B%0D%0A+++%22SITENAME%22%3A+%22MYSITE%22%2C%0D%0A+++%22OBJECTID%22%3A+1%0D%0A++%7D%0D%0A+%7D%5D%2C%0D%0A+%22fieldAliases%22%3A+%7B%0D%0A++%22SITENAME%22%3A+%22SITENAME%22%2C%0D%0A++%22OBJECTID%22%3A+%22OBJECTID%22%0D%0A+%7D%2C%0D%0A+%22fields%22%3A+%5B%0D%0A++%7B%0D%0A+++%22alias%22%3A+%22OBJECTID%22%2C%0D%0A+++%22type%22%3A+%22esriFieldTypeOID%22%2C%0D%0A+++%22name%22%3A+%22OBJECTID%22%0D%0A++%7D%2C%0D%0A++%7B%0D%0A+++%22alias%22%3A+%22SITENAME%22%2C%0D%0A+++%22length%22%3A+70%2C%0D%0A+++%22type%22%3A+%22esriFieldTypeString%22%2C%0D%0A+++%22name%22%3A+%22SITENAME%22%0D%0A++%7D%0D%0A+%5D%2C%0D%0A+%22displayFieldName%22%3A+%22SITENAME%22%2C%0D%0A+%22spatialReference%22%3A+%7B%0D%0A++%22wkid%22%3A+4269%2C%0D%0A++%22latestWkid%22%3A+4269%0D%0A+%7D%2C%0D%0A+%22geometryType%22%3A+%22esriGeometryPoint%22%0D%0A%7D&env%3AoutSR=&env%3AprocessSR=&returnZ=false&returnM=false&f=pjson { "results": [ ], "messages": [ { "type": "esriJobMessageTypeInformative", "description": "Executing (JSON To Feature Class subprocess): JsonToFcSubprocess {\"features\":[{\"geometry\":{\"y\":35.748388281000075,\"x\":-114.85761096699997},\"attributes\":{\"SITENAME\":\"MYSITE\",\"OBJECTID\":1}}],\"fieldAliases\":{\"SITENAME\":\"SITENAME\",\"OBJECTID\":\"OBJECTID\"},\"fields\":[{\"alias\":\"OBJECTID\",\"type\":\"esriFieldTypeOID\",\"name\":\"OBJECTID\"},{\"alias\":\"SITENAME\",\"length\":70,\"type\":\"esriFieldTypeString\",\"name\":\"SITENAME\"}],\"displayFieldName\":\"SITENAME\",\"spatialReference\":{\"wkid\":4269,\"latestWkid\":4269},\"geometryType\":\"esriGeometryPoint\"}" }, { "type": "esriJobMessageTypeInformative", "description": "Start Time: Tue Aug 06 14:18:53 2013" }, { "type": "esriJobMessageTypeInformative", "description": "Executing (JsonToFcSubprocess): JsonToFcSubprocess {\"features\":[{\"geometry\":{\"y\":35.748388281000075,\"x\":-114.85761096699997},\"attributes\":{\"SITENAME\":\"MYSITE\",\"OBJECTID\":1}}],\"fieldAliases\":{\"SITENAME\":\"SITENAME\",\"OBJECTID\":\"OBJECTID\"},\"fields\":[{\"alias\":\"OBJECTID\",\"type\":\"esriFieldTypeOID\",\"name\":\"OBJECTID\"},{\"alias\":\"SITENAME\",\"length\":70,\"type\":\"esriFieldTypeString\",\"name\":\"SITENAME\"}],\"displayFieldName\":\"SITENAME\",\"spatialReference\":{\"wkid\":4269,\"latestWkid\":4269},\"geometryType\":\"esriGeometryPoint\"}" }, { "type": "esriJobMessageTypeInformative", "description": "Start Time: Tue Aug 06 14:18:53 2013" }, { "type": "esriJobMessageTypeInformative", "description": "Running script JsonToFcSubprocess..." }, { "type": "esriJobMessageTypeInformative", "description": "Converting JSON to FC..." }, { "type": "esriJobMessageTypeWarning", "description": "Could not run JSONToFeature_conversion nativly... Attempting to run in 32-bit mode..." }, { "type": "esriJobMessageTypeInformative", "description": "SUBPROCESS COMMAND: \n\\\\<SERVER>\\<SHARE>$\\directories\\arcgissystem\\arcgisinput\\ExtractDataTools\\JsonToFcSubprocess.GPServer\\extracted\\v101\\..\\cd\\arcgis10_2\\python.exe -c \"\n import sys\n sys.path=[]\n sys.path.append(r'C:\\Windows\\system32\\python27.zip')\n sys.path.append(r'C:\\Python27\\ArcGIS10.2\\DLLs')\n sys.path.append(r'C:\\Python27\\ArcGIS10.2\\lib')\n sys.path.append(r'C:\\Python27\\ArcGIS10.2\\lib\\plat-win')\n sys.path.append(r'C:\\Python27\\ArcGIS10.2\\lib\\lib-tk')\n sys.path.append(r'C:\\Python27\\ArcGIS10.2')\n sys.path.append(r'C:\\Python27\\ArcGIS10.2\\lib\\site-packages')\n sys.path.append(r'C:\\Program Files (x86)\\ArcGIS\\Desktop10.2\\bin')\n sys.path.append(r'C:\\Program Files (x86)\\ArcGIS\\Desktop10.2\\arcpy')\n sys.path.append(r'C:\\Program Files (x86)\\ArcGIS\\Desktop10.2\\ArcToolbox\\Scripts')\n import arcpy;\n res=arcpy.JSONToFeatures_conversion('C:/Users/<SERVICE ACCOUNT>/AppData/Local/Temp/extractdatatools/jsontofcsubprocess_gpserver/j68e8efd3ab8c4a4aaec0045ab6debe1a/scratch/DATA_EXTRACT_130806_141853.json','C:/Users/<SERVICE ACCOUNT>/AppData/Local/Temp/extractdatatools/jsontofcsubprocess_gpserver/j68e8efd3ab8c4a4aaec0045ab6debe1a/scratch/DATA_EXTRACT_130806_141853.gdb/DATA_EXTRACT_130806_141853')\n print res.status\n print res.getMessages()\n \"\n " }, { "type": "esriJobMessageTypeInformative", "description": "Completed script JsonToFcSubprocess..." }, { "type": "esriJobMessageTypeInformative", "description": "Succeeded at Tue Aug 06 14:18:55 2013 (Elapsed Time: 1.84 seconds)" }, { "type": "esriJobMessageTypeInformative", "description": "Succeeded at Tue Aug 06 14:18:55 2013 (Elapsed Time: 1.84 seconds)" } ] }
... View more
08-06-2013
12:23 PM
|
0
|
0
|
2019
|
|
POST
|
Cannot create FeatureClass 'C:\Users\<AGS SERVICE ACCOUNT>\AppData\Local\Temp\extractdatatools\jsontofc_gpserver\j631f8a7a49c34355a03361601e636c75\scratch\scratch.gdb\DATA_EXTRACT_130805_095310'
Just a complete shot in the dark here and I have absolutely zero experience with this method, but... Have you attempted to write the FC to in_memory instead of the Scratch.gdb? Really not sure if this is going to anything at all for you, but maybe worth a try. Great suggestion. I swapped the output to 'in_memory\<FC_NAME>' with no luck...
import os
import arcpy
from datetime import datetime
######################################
###### Getting params ######
######################################
input_json=arcpy.GetParameterAsText(0)
######################################
###### Store Data ######
######################################
dt="DATA_EXTRACT_"+datetime.today().strftime("%y%m%d_%H%M%S")
json_file=os.path.join(arcpy.env.scratchFolder,"%s.json"%dt)
#fc=os.path.join(arcpy.env.scratchGDB,dt)
fc="in_memory\%s"%dt
###CONVERT JSON TO FC###
arcpy.AddMessage("Converting JSON to FC...")
f=open(json_file,'w')
f.write(input_json)
f.close()
res=arcpy.JSONToFeatures_conversion(json_file,fc)
###Storing result...###
arcpy.SetParameter(1,arcpy.FeatureSet(fc))
###cleanup...###
#arcpy.Delete_management(fc)
#arcpy.Delete_management(json_file)
And here is the result in the server log. Once again it succeeded from ArcGIS Desktop... Traceback (most recent call last): File "\\<HOST>\<SHARE>$\directories\arcgissystem\arcgisinput\ExtractDataTools\JsonToFc.GPServer\extracted\v101\zipandship\JsonToFc.py", line 45, in res=arcpy.JSONToFeatures_conversion(json_file,fc) File "c:\program files\arcgis\server\arcpy\arcpy\conversion.py", line 430, in JSONToFeatures raise e ExecuteError: ERROR 000206: Cannot create FeatureClass 'in_memory\DATA_EXTRACT_130806_075502'. Failed to execute (JSONToFeatures). Failed to execute (JsonToFc). Failed to execute (JSON To Feature Class). I have spent a little more time with some testing. This appears that it does not work when running in 64-bit mode. I've run the script tool from a cmd.exe process in the C:\Python27\ArcGIS10.2 directory.. Runs just fine. I change my directory to C:\Python27\ArcGISx6410.2 and it fails with the same error... If I get some time I will report this 'bug' with Esri. In the meantime... does anyone know if there is an easy way to have the process run in 32-bit mode from the ArcGIS Server service account? I might try doing a 'subprocess' call to the 32-bit python executable as a temporary work around. I will post back if that works. Thanks for the help!
... View more
08-06-2013
06:08 AM
|
0
|
0
|
2019
|
|
POST
|
I love the new JSONToFeature_conversion tool that was just released at 10.2 Works great when running it from ArcGIS Desktop, but not from ArcGIS Server... Here is a simple script and output. I would rather pass in the RAW JSON data rather than store it to a file so the script accepts basic text (string param type) and creates the JSON file, stores the text and runs the tool. import os import arcpy from datetime import datetime ###################################### ###### Getting params ###### ###################################### input_json=arcpy.GetParameterAsText(0) ###################################### ###### Store Data ###### ###################################### dt="DATA_EXTRACT_"+datetime.today().strftime("%y%m%d_%H%M%S") json_file=os.path.join(arcpy.env.scratchFolder,"%s.json"%dt) fc=os.path.join(arcpy.env.scratchGDB,dt) ###CONVERT JSON TO FC### arcpy.AddMessage("Converting JSON to FC...") f=open(json_file,'w') f.write(input_json) f.close() res=arcpy.JSONToFeatures_conversion(json_file,fc) ###Storing result...### arcpy.SetParameter(1,arcpy.FeatureSet(fc)) Here is a real simple JSON input: {"features": [{"geometry": {"y": 35.748388281000075, "x": -114.85761096699997}, "attributes": {"SITENAME": "MYSITE", "OBJECTID": 1}}], "fieldAliases": {"SITENAME": "SITENAME", "OBJECTID": "OBJECTID"}, "fields": [{"alias": "OBJECTID", "type": "esriFieldTypeOID", "name": "OBJECTID"}, {"alias": "SITENAME", "length": 70, "type": "esriFieldTypeString", "name": "SITENAME"}], "displayFieldName": "SITENAME", "spatialReference": {"wkid": 4269, "latestWkid": 4269}, "geometryType": "esriGeometryPoint"} If you run this from desktop then here is the result: Executing: JsonToFc "{"features": [{"geometry": {"y": 35.748388281000075, "x": -114.85761096699997}, "attributes": {"SITENAME": "MYSITE", "OBJECTID": 1}}], "fieldAliases": {"SITENAME": "SITENAME", "OBJECTID": "OBJECTID"}, "fields": [{"alias": "OBJECTID", "type": "esriFieldTypeOID", "name": "OBJECTID"}, {"alias": "SITENAME", "length": 70, "type": "esriFieldTypeString", "name": "SITENAME"}], "displayFieldName": "SITENAME", "spatialReference": {"wkid": 4269, "latestWkid": 4269}, "geometryType": "esriGeometryPoint"}" Start Time: Mon Aug 05 09:51:35 2013 Running script JsonToFc... Converting JSON to FC... Completed script JsonToFc... Succeeded at Mon Aug 05 09:51:44 2013 (Elapsed Time: 9.49 seconds) but publish to ArcServer succeeds and when trying to run it fails to create the feature class... { "error": { "code": 400, "message": "Unable to complete operation.", "details": [ "Error executing tool." ] } } And here is the content in the server logs: Level Time Message Source Machine Code Time Elapsed User Name Process Thread Method Name SEVERE Aug 5, 2013, 9:53:11 AM Error executing tool. ExtractDataTools/JsonToFc.GPServer <HOSTNAME>.<DOMAINNAME> 20010 anonymous 5212 7528 GPServerSync.CheckMessages SEVERE Aug 5, 2013, 9:53:11 AM Traceback (most recent call last): File "\\<FILESERVER>\<SHARE>$\directories\arcgissystem\arcgisinput\ExtractDataTools\JsonToFc.GPServer\extracted\v101\zipandship\JsonToFc.py", line 44, in res=arcpy.JSONToFeatures_conversion(json_file,fc) File "c:\program files\arcgis\server\arcpy\arcpy\conversion.py", line 430, in JSONToFeatures raise e ExecuteError: ERROR 000206: Cannot create FeatureClass 'C:\Users\<AGS SERVICE ACCOUNT>\AppData\Local\Temp\extractdatatools\jsontofc_gpserver\j631f8a7a49c34355a03361601e636c75\scratch\scratch.gdb\DATA_EXTRACT_130805_095310'. Failed to execute (JSONToFeatures). Failed to execute (JsonToFc). Failed to execute (JSON To Feature Class). Any help is greatly appreciated.. I've tinkered with this for a few days with no success. Tried changing the path of the FGDB to a custom location (not the arcpy environment workspaces) with no luck. Made sure the service account has at least modify permissions to the output locations. I can run these just from desktop. ArcGIS Desktop 10.2 ArcGIS Server 10.2 Portal for ArcGIS v 2.2 (ArcServer is federated with the portal) Thanks!
... View more
08-05-2013
08:50 AM
|
0
|
8
|
3137
|
|
POST
|
In addition - I can still describe the feature using a simple SearchCursor: >>> sc=arcpy.SearchCursor("complexfeatures")
>>> row=sc.next()
>>> row.SHAPE.JSON
u'{"paths":[[[-107.73663618399996,32.118442362000053],[-107.73884077039791,32.119504690926618],[-107.74105642221301,32.120527416729146],... <Removed for length> ]]],"spatialReference":{"wkid":4269}}'
>>>
>>> json.loads(row.SHAPE.JSON)
{u'paths': [[[-107.73663618399996, 32.11844236200005], [-107.73884077039791, 32.11950469092662], [-107.741056422213, 32.120527416729146], [-107.74328313944785, 32.12151053940891], [-107.74552092210487, 32.12245405896694], [-107.74776977018637, 32.1233579754042], [-107.75002968369428, 32.12422228872146], [-107.75230066263127, 32.12504699891979], [-107.75458270699994, 32.125832106000075], [-107.75659821899549, 32.12652689818116], [-107.75890406515417, 32.12736096534411], [-107.7666821019275, 32.13028862152029], [-107.76958348743116, 32.131359269059764], [-107.77228464403181, 32.13231601581619], [-107.77473470999132, 32.13313605229926], [-107.77626089730433, 32.133617955489875], [-107.77772344080708, 32.1340552612864], [-107.77913117752215, 32.13445060766041], [-107.78048977721855, 32.134805580023084], [-107.78180549588528, 32.135121762264916], [-107.78308006205398, 32.135399516422645], [-107.78431635157999, 32.135639467773984], [-107.78551650304402, 32.13584202945609], [-107.78682130311263, 32.13602504846348], [-107.78808506738325, 32.13616175389723], [-107.78930956314306, 32.13625233583096], [-107.79049616390569, 32.13629689444882], [-107.79164633087659, 32.136295469626624], [-107.79276078276014, 32.136248044824185], [-107.79384039381608, 32.13615458225699], [-107.79488587568524, 32.1360150196027], [-107.79589885597944, 32.135829063924575], [-107.79687881627672, 32.135596732116255], [-107.79782624013392, 32.135317909177175], [-107.79874153209693, 32.13499247562364], [-107.79962511107819, 32.13462027716119], [-107.80047723427302, 32.13420119986392],...<Removed for length>]], u'spatialReference': {u'wkid': 4269}}
... View more
05-28-2013
09:28 AM
|
0
|
4
|
1821
|
|
POST
|
I am having a problem using the arcpy.FeatureSet() method to load a polyline to a JSON structure (python Dictionary). It seems that if features were constructed using 'freehand' that the arcpy.FeatureSet().JSON that the 'paths' key returns a truncated, incomplete list. Any support is greatly appreciated. Details below: Testing from an ArcGIS Desktop 10.1 SP1 Scenario 1 - Works: Basic Steps: Start Editing Open 'Create Features' frame Choose 'Line' under 'Construction Tools' Draw a simple line with few verticies Select the Line view the JSON from arcpy.FeatureSet(input).JSON JSON looks complete
>>> import json
>>> arcpy.FeatureSet('complexfeatures').JSON
u'{"displayFieldName":"","fieldAliases":{"OBJECTID":"OBJECTID","ASSET_NUM":"ASSET_NUM","PROVIDER":"PROVIDER","CREATED_USER":"CREATED_USER","CREATED_DATE":"CREATED_DATE","LAST_EDITED_USER":"LAST_EDITED_USER","LAST_EDITED_DATE":"LAST_EDITED_DATE","Shape_Length":"Shape_Length"},"geometryType":"esriGeometryPolyline","spatialReference":{"wkid":4269,"latestWkid":4269},"fields":[{"name":"OBJECTID","type":"esriFieldTypeOID","alias":"OBJECTID"},{"name":"ASSET_NUM","type":"esriFieldTypeString","alias":"ASSET_NUM","length":12},{"name":"PROVIDER","type":"esriFieldTypeString","alias":"PROVIDER","length":50},{"name":"CREATED_USER","type":"esriFieldTypeString","alias":"CREATED_USER","length":255},{"name":"CREATED_DATE","type":"esriFieldTypeDate","alias":"CREATED_DATE","length":8},{"name":"LAST_EDITED_USER","type":"esriFieldTypeString","alias":"LAST_EDITED_USER","length":255},{"name":"LAST_EDITED_DATE","type":"esriFieldTypeDate","alias":"LAST_EDITED_DATE","length":8},{"name":"Shape_Length","type":"esriFieldTypeDouble","alias":"Shape_Length"}],"features":[{"attributes":{"OBJECTID":30,"ASSET_NUM":null,"PROVIDER":null,"CREATED_USER":null,"CREATED_DATE":null,"LAST_EDITED_USER":null,"LAST_EDITED_DATE":null,"Shape_Length":0.36837905314970948},"geometry":{"paths":[[[-108.05333952499996,32.113163973000042],[-107.92771386599998,32.035043815000051],[-107.96677394499994,31.967480436000073],[-108.10401205899996,31.92947603500005]]]}}]}'
>>> json.loads(arcpy.FeatureSet('complexfeatures').JSON)
{u'features': [{u'geometry': {u'paths': [[[-108.05333952499996, 32.11316397300004], [-107.92771386599998, 32.03504381500005], [-107.96677394499994, 31.967480436000073], [-108.10401205899996, 31.92947603500005]]]}, u'attributes': {u'Shape_Length': 0.3683790531497095, u'OBJECTID': 30, u'PROVIDER': None, u'ASSET_NUM': None, u'CREATED_USER': None, u'CREATED_DATE': None, u'LAST_EDITED_DATE': None, u'LAST_EDITED_USER': None}}], u'fieldAliases': {u'Shape_Length': u'Shape_Length', u'OBJECTID': u'OBJECTID', u'PROVIDER': u'PROVIDER', u'ASSET_NUM': u'ASSET_NUM', u'CREATED_USER': u'CREATED_USER', u'CREATED_DATE': u'CREATED_DATE', u'LAST_EDITED_DATE': u'LAST_EDITED_DATE', u'LAST_EDITED_USER': u'LAST_EDITED_USER'}, u'fields': [{u'alias': u'OBJECTID', u'type': u'esriFieldTypeOID', u'name': u'OBJECTID'}, {u'alias': u'ASSET_NUM', u'length': 12, u'type': u'esriFieldTypeString', u'name': u'ASSET_NUM'}, {u'alias': u'PROVIDER', u'length': 50, u'type': u'esriFieldTypeString', u'name': u'PROVIDER'}, {u'alias': u'CREATED_USER', u'length': 255, u'type': u'esriFieldTypeString', u'name': u'CREATED_USER'}, {u'alias': u'CREATED_DATE', u'length': 8, u'type': u'esriFieldTypeDate', u'name': u'CREATED_DATE'}, {u'alias': u'LAST_EDITED_USER', u'length': 255, u'type': u'esriFieldTypeString', u'name': u'LAST_EDITED_USER'}, {u'alias': u'LAST_EDITED_DATE', u'length': 8, u'type': u'esriFieldTypeDate', u'name': u'LAST_EDITED_DATE'}, {u'alias': u'Shape_Length', u'type': u'esriFieldTypeDouble', u'name': u'Shape_Length'}], u'displayFieldName': u'', u'spatialReference': {u'wkid': 4269, u'latestWkid': 4269}, u'geometryType': u'esriGeometryPolyline'}
Notice how the 'paths' key in the JSON struct appears to be correct. Shows 4 simple XY verticies that were hand digitized on the map. I can also use the json module to load the string (json.loads) correctly into a pyton dict. Scenario 2 - Fails: Basic Steps: Start Editing Open 'Create Features' frame Choose 'Freehand' under 'Construction Tools' Draw a 's' shaped feature Select the Line view the JSON from arcpy.FeatureSet(input).JSON JSON is malformed and missing the 'paths' elements... >>> import json
>>>
>>> arcpy.FeatureSet('complexfeatures').JSON
u'{"displayFieldName":"","fieldAliases":{"OBJECTID":"OBJECTID","ASSET_NUM":"ASSET_NUM","PROVIDER":"PROVIDER","CREATED_USER":"CREATED_USER","CREATED_DATE":"CREATED_DATE","LAST_EDITED_USER":"LAST_EDITED_USER","LAST_EDITED_DATE":"LAST_EDITED_DATE","Shape_Length":"Shape_Length"},"geometryType":"esriGeometryPolyline","spatialReference":{"wkid":4269,"latestWkid":4269},"fields":[{"name":"OBJECTID","type":"esriFieldTypeOID","alias":"OBJECTID"},{"name":"ASSET_NUM","type":"esriFieldTypeString","alias":"ASSET_NUM","length":12},{"name":"PROVIDER","type":"esriFieldTypeString","alias":"PROVIDER","length":50},{"name":"CREATED_USER","type":"esriFieldTypeString","alias":"CREATED_USER","length":255},{"name":"CREATED_DATE","type":"esriFieldTypeDate","alias":"CREATED_DATE","length":8},{"name":"LAST_EDITED_USER","type":"esriFieldTypeString","alias":"LAST_EDITED_USER","length":255},{"name":"LAST_EDITED_DATE","type":"esriFieldTypeDate","alias":"LAST_EDITED_DATE","length":8},{"name":"Shape_Length","type":"esriFieldTypeDouble","alias":"Shape_Length"}],"features":[{"attributes":{"OBJECTID":31,"ASSET_NUM":null,"PROVIDER":null,"CREATED_USER":null,"CREATED_DATE":null,"LAST_EDITED_USER":null,"LAST_EDITED_DATE":null,"Shape_Length":0.31265287393441688},"geometry":{"paths":['
>>> json.loads(arcpy.FeatureSet('complexfeatures').JSON)
Runtime error
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Python27\ArcGIS10.1\Lib\json\__init__.py", line 326, in loads
return _default_decoder.decode(s)
File "C:\Python27\ArcGIS10.1\Lib\json\decoder.py", line 366, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "C:\Python27\ArcGIS10.1\Lib\json\decoder.py", line 382, in raw_decode
obj, end = self.scan_once(s, idx)
ValueError: Expecting object: line 1 column 1259 (char 1259)
Notice how the 'paths' value does not contain a valid array? I have the same problem if I try to declare the FeatureSet empty and load it using something like:
fs=arcpy.FeatureSet()
fs.load(in_features)
... View more
05-28-2013
09:07 AM
|
1
|
5
|
5173
|
|
POST
|
Hi Pat, We have been using Windows Domain all along.. We did try switching to Build in which worked relatively faster, but we cannot use that security model on our Production Domain. -Muneer One solution you may consider - set the following configuration settings: User Store: Windows Domain Role Store: ArcGIS Built-in then write some code to synchronize some AD groups to your ArcGIS built-in role store. Therefore you would still obtain single signon and single user store (since they are in AD/Windows Domain). We have that setting and performance went from horrible to adequate. Users do not need to maintain a separate user account since the user store is tied to Active Directory. There is a little more overhead on our IT operations staff to maintain the role store in the ArcGIS Server (Built-in) but that extra maintenance is well worth the IT operations time since it saves so much performance gains on the ArcGIS server solution. This is speaking from a government agency where security is always at the forefront... HTH!
... View more
03-11-2013
07:53 AM
|
0
|
1
|
1026
|
|
POST
|
We have been experiencing similar issues for a while.. We have currently installed 10.1 on a Test Server but plan to roll it into production to replace our existing 10.0 ArcGIS Server by the month of May. But I guess we aren't making the deadlines because of the performance issues.. Local browsing to 10.1 Services whether with ArcCatalog or with IE is pretty fast on the Server itself, however as soon as you go to a client machine and pass the intranet + the Company Active Directory Groups, the performance is agonizingly slow.. And this is only while browsing through the ArcGIS Server Folder/Directories, direct URL's to any of our map services work just fine within out client applications.. We have been working with ESRI Tech Support for the last two weeks, but nothing productive has come up yet. Any suggestions here? Regards, Muneer Majid Spatial & GIS Analyst Chevron Energy Technology Company What is your config setting for user and role store? Built in or windows domain? Or hybrid?
... View more
03-09-2013
11:36 AM
|
0
|
0
|
1687
|
|
POST
|
Yes. It turns out there was an existing bug in 10.1 that did not allow a comma in a users full name. This was fixed in SP1. Did you have performance issues when using AD Groups before SP1? Wondering if that solved our performance issues with AD groups/roles. We had major performance impacts with users that were either in many AD groups or nested (sub) groups.
... View more
02-13-2013
08:05 AM
|
0
|
0
|
1687
|
|
POST
|
The SDE account should be very limited, and should NOT be able to update statistics on spatial tables. The table owner should be the only account used for statistics management. - V Hi Vince - thank you for the input. We use the SDE account for many database related administration tasks such as the compress and version management (the default version is 'owned' by sde and protected by our workflows so the rec&post needs to be executed with the sde account). ESRI recommends running an Analyze before and after each compress: http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#//002n00000059000000 When you update the statistics for a feature dataset, statistics for all the feature classes in that feature dataset are updated. If the feature dataset contains a geometric network, the network tables are also updated. You should update statistics before and after a compress operation, after you add or remove topology rules, and after you have finished importing, loading, or copying data into an ArcSDE geodatabase. So it seems that if the SDE/DB admin wants to automate the Analyze->Compress->Analyze (we are scheduling weekly) that they should use the 'sde' account instead of the data owner account, since there can be many different owners to the data, and since the compress is handled by the same SDE account. SDE/DB admins do not always have the connection parameters (passwords) to user accounts who may own the data. I was looking to use the 'Analyze Datasets' tool as documented here: http://resources.arcgis.com/en/help/main/10.1/#/Analyze_Datasets/00170000014z000000/ but we are still on ESRI version 10.0 for some of our solutions/applications. For future reference: It looks like the 'Analyze Datasets' tool documents that account must be the data owner as well: Note that the connected user must be the data owner for the datasets provided. Thanks for the input. We will continue to use the data owner account and keep this in mind for future implementations where we may have multiple accounts which 'own' the data.
... View more
02-05-2013
12:45 PM
|
0
|
0
|
936
|
|
POST
|
We have a few Oracle 11g databases deployed to a SLES 11 environment that are running ArcSDE 10.0 SP4 Here is the message I get when I try to run the 'Analyze' tool using the 'sde' account (using ArcGIS Desktop 10.0 SP4): Messages Executing: Analyze "Database Connections\SDE_ACCOUNT.sde\DATA_OWNER_ACCOUNT.TABLE_NAME" BUSINESS Start Time: Tue Feb 05 07:20:10 2013 ERROR 999999: Error executing function. Underlying DBMS error [ORA-20000: Unable to analyze TABLE "DATA_OWNER_ACCOUNT"."TABLE_NAME", insufficient privileges or does not exist ORA-06512: at "SYS.DBMS_STATS", line 23818 ORA-06512: at "SYS.DBMS_STATS", line 23880 ORA-06512: at line 1 ] Failed to execute (Analyze). Failed at Tue Feb 05 07:20:11 2013 (Elapsed Time: 1.00 seconds) I can successfully run the 'Analyze' tool using the data owner account: Messages Executing: Analyze "Database Connections\DATA_OWNER_ACCOUNT.sde\DATA_OWNER_ACCOUNT.TABLE_NAME" BUSINESS;ADDS;DELETES Start Time: Tue Feb 05 07:19:31 2013 Succeeded at Tue Feb 05 07:19:33 2013 (Elapsed Time: 2.00 seconds) I had my oracle DBA grant the 'ANALYZE ANY' priv to the 'sde' account and now get the following error when trying to Analyze with the 'sde' account: Messages Executing: Analyze "Database Connections\SDE_ACCOUNT.sde\DATA_OWNER_ACCOUNT.TABLE_NAME" BUSINESS;FEATURE;ADDS;DELETES Start Time: Tue Feb 05 08:48:20 2013 ERROR 999999: Error executing function. Table is not multiversion, but must be for this operation Failed to execute (Analyze). Failed at Tue Feb 05 08:48:22 2013 (Elapsed Time: 2.00 seconds) I can still successfully Analyze with the data owner account, but it seems that I should be able to do this with the sde admin account as well. Documentation on the Analyze tool: http://help.arcgis.com/en/arcgisdesktop/10.0/help/#/Analyze/0017000000n2000000/ Any help/advise? I've worked the data owner account into our Analyze->Compress->Analyze workflows, but we will run into some of these issues when we have more than 1 data owner and the tables that are registered as versioned and are being edited. It almost seems that the 'sde' account does not quite see the 'a' and/or 'd' tables (delta tables). Maybe? Thanks in advance!
... View more
02-05-2013
09:03 AM
|
0
|
2
|
1554
|
|
POST
|
I've got several mxd's that I'm publishing with all their layers off by default and get the below error. The services publish anyway but are stopped. I simply start them and they are good to go. I would be great not to get this error though.
Executing (Publish Service Definition): PublishServiceDefinition ... #
{"buildInitialCache":false}
Start Time: Fri Oct 26 14:42:39 2012
Validating publish options.
Connecting to the server.
Getting basic item metadata for service definition upload.
Getting server information (server folders, data stores, etc.).
Extracting manifiest from uploaded service definition.
Validating service definition.
Determining service's input folder name.
Attempt to find service's input folder.
Creating the service.
ERROR 001170: The reduced study area polygon is too small for analysis.
Failed to execute (UploadServiceDefinition).
Failed at Fri Oct 26 14:42:41 2012 (Elapsed Time: 3.00 seconds)
We ran into this same issue today. Real small mapping service. Its got about 20 GIS features (20 rows all are point geometry type) that are stored in a FDGB on a fileshare. Data is registered with the server (not copying). This is a distributed GIS Site with 2 load balanced web-adaptors, and 4 GIS servers (2 clusters with 2 servers each). Administration is disabled at the web-adaptors and we are publishing from one of the servers in the GIS site. restarting (stopping/starting) the Publishing Tools GP service did not fix it. I've got 3 other mapping services that are all about the same size and they all worked just fine. Anyone else with this issue??:confused:
... View more
01-18-2013
12:26 PM
|
0
|
0
|
3198
|
|
POST
|
Is there any idea for a work around? I would like to give this tool to another employee but I do not want to see there password if I need to modify the script in the future. I've used the getpass methods in a subprocess to ask the user for a password during execution time to get around this limitation. See a similar thread here: http://forums.arcgis.com/threads/37576-Encrypting-a-password-parameter?p=260077#post260077 Best of luck!
... View more
12-31-2012
08:54 AM
|
0
|
0
|
2075
|
|
POST
|
getpass works fine for standalone scripts but it seems it lock everything up if I use it in a script that is run from in ArcMap (10.0). I guess that it is still waiting for input that will never arrive. I presume that this is for a similar reason to print statements not working in this environment. There is an parameter type for scripts (ArcGIS 10.0) called "Encrypted String" which does mask on input but I am not sure what you can do with it in the script. I assume that the original poster wanted to then pass on the parameter to something else or compare it to known values as would I. I've had similar issues and requirements. My basic requirement was to allow a user to change their database password. So what I did is use getpass in a subprocess to ask the user for a new password (and to verify the new password). I'v essentially implemented these two methods:
import subprocess
def promptForPassword():
pwd=promptInNewProcess()
pwd2=promptInNewProcess("Verify the new password: ")
return pwd,pwd2
def promptInNewProcess(prompt="Enter a new password: "):
cmd=r'python -c "from getpass import getpass; pwd=getpass(\"'+prompt+r'\"); print pwd"'
p = subprocess.Popen(cmd, stdout=subprocess.PIPE)
out, err = p.communicate()
if (err==None):
return out.strip()
return ""
And then called these from my python script that is pointed to from a toolbox script:
import arcpy
from OraclePasswordFunctions import promptForPassword
if __name__ == "__main__":
if (len(sys.argv)<>2):
print "There is 1 required input: "
print " - SDE connection file to an ORACLE database (.sde). The user in the sde connection file is will be the user who's password gets changed"
sys.exit(0)
arcpy.AddMessage("\n\n\nThis utility will change the password of a SDE connection file. A command prompt will appear and ask for a new password. A second command prompt will then appear to validate the password (verify the inputs are the same). This utility uses the following criteria for password strength: ")
arcpy.AddMessage(" - 8 or more characters in length")
arcpy.AddMessage(" - 30 or less characters in length")
arcpy.AddMessage(" - Start with an alpha character [a..z] or [A..Z]")
arcpy.AddMessage(" - Contain at least 1 lower case character")
arcpy.AddMessage(" - Contain at least 1 upper case character")
arcpy.AddMessage(" - Contain at least 1 numeric character")
arcpy.AddMessage(" - Contain at least 1 special character. The only special characters allowed are '_' or '#' or '$' (without quotes)")
arcpy.AddMessage("\n\n\n")
sde_ws = arcpy.GetParameterAsText(0)
pwd1,pwd2=promptForPassword()
Then what I did was compare pwd1 and pwd2 (to verify they met the requirements and that it was the same password). If all succeeded then I called the arcpy.ArcSDESQLExecute methods to run an 'ALTER USER' statement This makes it interactive so that its not really scriptable. A user runs the tool and it opens a command prompt (black box) that asks for their password. When they hit enter it closes that one and opens a new command prompt asking for the user to verify the password.
... View more
12-31-2012
08:52 AM
|
0
|
0
|
2033
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 02-18-2016 03:07 PM | |
| 1 | 07-09-2012 09:32 AM | |
| 1 | 06-30-2016 12:12 PM | |
| 1 | 03-24-2015 09:33 AM | |
| 1 | 03-25-2015 08:29 AM |
| Online Status |
Offline
|
| Date Last Visited |
11-11-2020
02:23 AM
|