POST
|
Hi and thanks for the great questions! both the command line and the Pyscripter are Python 2.7.5, win32 on win 32. the problem seems to come in this function, although prior this step it creates the serverConnection.ags file successfully. def registerDatabaseWithServer(databaseConnection, arcgisServerAdminConnection, arcgisServerDataStoreName): dataStoreType = "DATABASE" removeRegisteredDataStore(arcgisServerAdminConnection, arcgisServerDataStoreName, dataStoreType) arcpy.AddDataStoreItem(arcgisServerAdminConnection, dataStoreType, arcgisServerDataStoreName, databaseConnection, databaseConnection) I tried putting a try exception, on this and pass if fails and it proceeded through the rest of the deployment except it warns that the datasource was not registered with the server. I do so really want to get this to work as it will offer a great deal of automation and consistency to our map service publishing. Thanks for any further advice you can offer
... View more
03-09-2016
02:29 PM
|
0
|
0
|
600
|
POST
|
I have a great little Python script that works fabulously to deploy map services and register data sources. It works well on my PC, in Pyscripter and from the command line but only works in Pyscripter on the server, where I wish to have a Jenkins job do the deployment. When run from the command line on the server it returns "Cannot connect to database", in Pyscripter it just works. If anyone has a clue why this could be, it does not appear to be a user and permission issue. Output from Pyscripter: Command Line : DEV The following information was returned during analysis of the MXD: ----MESSAGES--- Layer draws at all scale ranges (CODE 30003) applies to: Bid Points Bid Lines Bid Points Bid Lines ----WARNINGS--- ----ERRORS--- Service BIDS, successfully published Executing: UploadServiceDefinition "C:\Program Files (x86)\Jenkins\workspace\MAP-DEPLOY\MXD\BIDS.sd" "C:\Program Files (x86)\Jenkins\workspace\MAP-DEPLOY\MXD\serverconnection.ags" # # FROM_SERVICE_DEFINITION # STARTED USE_DEFINITION NO_SHARE_ONLINE PRIVATE NO_SHARE_ORGANIZATION # Start Time: Fri Mar 18 13:40:44 2016 Submitted. Executing... Executing (Publish Service Definition): PublishServiceDefinition i6cdf6dfc-7490-426c-a096-4f8e77852141 # {"buildInitialCache":false} # Start Time: Fri Mar 18 13:40:45 2016 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. Deriving arcgis server service from hosted service (hosted service definition). Validating service definition. Determining service's input folder name. Attempt to find service's input folder. Creating the service. Adding item information card to service. Updating file and folder information in service's manifest. Updating database information in service's manifest. Adding manifest to configuration store. Building the service URLs. Succeeded at Fri Mar 18 13:41:17 2016 (Elapsed Time: 32.17 seconds) Succeeded. Succeeded at Fri Mar 18 13:41:17 2016 (Elapsed Time: 33.10 seconds) Output from Command line: C:\Program Files (x86)\Jenkins\workspace\MAP-DEPLOY>python MXD\Deploy_MXD.py DEV Cannot open server connection to database. Also see comments below
... View more
03-07-2016
04:48 PM
|
1
|
2
|
3012
|
POST
|
Excellent that sounds exactly what I am trying to do, sorry my previous response is out out of sync and now irrelevant. I only have one problem how do I find that to download, what I have ins the WebAppViewer. Where is "WAB Developer's Edition (Beta 3"? None the less thanks heaps???
... View more
12-04-2014
05:37 PM
|
0
|
1
|
478
|
POST
|
Ultimately I am wanting to develop a custom widget so I followed the instructions I found, and download "webappviewer.zip" from Web AppBuilder for ArcGIS (Beta) details page.
... View more
12-04-2014
05:32 PM
|
0
|
0
|
478
|
POST
|
I am wanting to develop a custom widget so I have followed the instructions and downloaded the Web App as a zip, changed the configs as described and then it says "host it". Host it where with what??? IIS (6,7, 7.5), Tomcat, Nodejs, ArcGIS server??? If it is AGS how do you do that??
... View more
12-04-2014
03:16 PM
|
0
|
5
|
3636
|
POST
|
We have been trying (for days) to create a polygon features from a CSV of min xy and max xy, held as GDA94 (lat,long) and it does not work for the majority of records. Only one works. I have added both the code and data. We are creating the corresponding points to ensure the correct import and that works but when we Append to create the polygon it works but a feature of zero area is created. There is no reported error in the script. Python code import arcpy, fileinput, os from arcpy import env env.overwriteOutput = True infile = "C:/temp/M80/Metadata_RP.csv" pt1 = arcpy.Point() pt2 = arcpy.Point() pt3 = arcpy.Point() pt4 = arcpy.Point() ptGeoms = [] point = arcpy.Point() array = arcpy.Array() featureList= [] curXY = arcpy.da.SearchCursor(infile, ["o_minx","o_miny","o_maxx","o_maxy"]) for row in curXY: message = "{0}, {1}, {2}, {3}".format(row[0], row[1], row[2], row[3]) arcpy.AddMessage(message) o_minx= row[0] o_miny=row[1] o_maxx=row[2] o_maxy=row[3] message = "{0}, {1}, {2}, {3}".format(o_minx,o_miny,o_maxx,o_maxy) pt1.X = o_minx pt1.Y = o_miny ptGeoms.append(arcpy.PointGeometry(pt1)) pt2.X = o_maxx pt2.Y = o_miny ptGeoms.append(arcpy.PointGeometry(pt2)) pt3.X = o_maxx pt3.Y = o_maxy ptGeoms.append(arcpy.PointGeometry(pt3)) pt4.X = o_minx pt4.Y = o_maxy ptGeoms.append(arcpy.PointGeometry(pt4)) arcpy.AddMessage(message) array = arcpy.Array([pt1,pt2,pt3,pt4,pt1]) polygon = arcpy.Polygon(array) featureList.append(polygon) arcpy.CopyFeatures_management(featureList, r"C:/temp/M80/polys.shp") arcpy.CopyFeatures_management(ptGeoms, r"C:/temp/M80/points.shp") print arcpy.GetMessages() CSV data o_minx,o_miny,o_maxx,o_maxy 144.820900,-37.757700,144.827300,-37.755800 144.818700,-37.762200,144.823400,-37.759100 144.81900,-37.760800,144.824500,-37.758400 144.823800,-37.755800,144.829200,-37.753300 144.825500,-37.753400,144.832200,-37.75200 144.8209,-37.7577,144.8273,-37.7558 144.8187,-37.7622,144.8234,-37.7591 144.8268,-37.7524,144.8331,-37.7517 144.8292,-37.7506,144.8367,-37.7502 144.8203,-37.7621,144.8201,-37.761 144.8187,-37.7622,144.8234,-37.7591 144.8214,-37.7615,144.8224,-37.761 144.8192,-37.7622,144.8225,-37.7608 144.8209,-37.7577,144.8273,-37.7558 144.8187,-37.7622,144.8234,-37.7591
... View more
02-20-2014
03:26 PM
|
0
|
2
|
2943
|
POST
|
Hi, I am having this issue that the row.getValue(field.name) breaks my script rows = arcpy.SearchCursor(DBase_file)
for row in rows:
for field in desc.fields:
rVal = row.getValue(field.name)
arcpy.AddMessage("Field Name: " + field.Name + "Value: " + rVal) In the examples above you have a haed coded field name but I am looping through unknown field names and it just stops at the rVal=... line. Any ideas??
... View more
05-16-2013
05:54 PM
|
0
|
0
|
11435
|
POST
|
Oh well as would be the case I spoke too soon. Initially, it did finish but when I actually reviewed the results It had only calculated the coordinates for the first 1970 records (Start_X, Start_Y, End_X, End_Y) ???? So to check that result I tried to redo it but this time ArcMap CRASHED!!! It asked if I wanted to send an error report to ESRI and I said yes, why not? Then comes the funny bit.... ...then would you believe it that Crashed also!!! [ATTACH=CONFIG]24354[/ATTACH] So really it is back to my original question ... how do I do this?????
... View more
05-15-2013
07:27 PM
|
0
|
0
|
1123
|
POST
|
Ah overall thank you! The problem above I have found out is on the client end (ie. my machine) basically it just ran out of memory. I have now freed some memory and it works fine. Thanks
... View more
05-15-2013
07:00 PM
|
0
|
0
|
1123
|
POST
|
Thanks but it didn't work, well it did for a while then I got this after nearly 3 minutes Start_X !Shape.FirstPoint.X! PYTHON_9.3 # Start Time: Thu May 16 12:00:07 2013 ERROR 000539: Error running expression: GPVARIANTOBJECT0.FirstPoint.X Traceback (most recent call last): File "<expression>", line 1, in <module> SystemError: error return without exception set The index was either too large or too small. Failed to execute (Calculate Field). Failed at Thu May 16 12:02:50 2013 (Elapsed Time: 2 minutes 43 What does it mean? Essentially what you told me was correct and it worked a bit then stopped!! It did 1970 of the 2843 in the file [ATTACH=CONFIG]24353[/ATTACH]
... View more
05-15-2013
06:25 PM
|
0
|
0
|
1123
|
POST
|
Hi, I have a similar problem but I need to put the calculation of the coordinates (start and end of a line) into a model or script so it can be run on a regular basis. Any clues?
... View more
05-15-2013
04:43 PM
|
0
|
0
|
1123
|
POST
|
We are having this problem also, does anyone have a solution?????
... View more
12-14-2011
02:29 PM
|
0
|
0
|
204
|
Title | Kudos | Posted |
---|---|---|
1 | 03-07-2016 04:48 PM |
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:23 AM
|