POST
|
Paging Alex Tereshenkov! I'm trying to run your script located here: Get data sources that are used by ArcGIS Server map services with Python | Tereshenkov's Blog but I'm getting an error when I get to here: def get_connection(data): '''return database connection string for the service''' return data['SVCManifest']['Databases']['SVCDatabase']['OnPremiseConnectionString'] Error: TypeError: list indices must be integers, not str Any ideas? This looks very useful!
... View more
12-01-2016
03:00 PM
|
0
|
2
|
1312
|
POST
|
Hi all! I need a little advise on improving performance on a working gp service. Currently I pass a "ticket number" as a parameter to my gp rest endpoint and the ticket number is used to query some coordinates and build a polygon which is intersected with some "inspector zones" polygons, I do a select by location and return json of the "inspector zone id" of the zone it intersects. I've looked over the geometry service "intersect" function and it looks like it won't do what I need, but that's why I'm asking! Could the geometry service intersect function do the overlay and return one of the intersected polygon attributes rather than the intersected coordinates?
... View more
11-18-2016
03:17 PM
|
0
|
0
|
684
|
POST
|
Much thanks! I thought it'd pick up the sr on it's own!
... View more
09-23-2016
01:31 PM
|
0
|
0
|
242
|
POST
|
I drew it out and it looks like it's clockwise, non-intersecting.
... View more
09-23-2016
01:23 PM
|
0
|
0
|
898
|
POST
|
GCS_WGS_1984 is the spref of the FC I'm inserting into.
... View more
09-23-2016
01:22 PM
|
0
|
2
|
898
|
POST
|
when I pass in the -111.8256, 40.691085 as above a record is created in the table, but w/ empty geometry.
... View more
09-23-2016
01:13 PM
|
0
|
4
|
898
|
POST
|
this doesn't work: array = arcpy.Array([arcpy.Point(-111.8256, 40.691085),
arcpy.Point(-111.825347, 40.691614),
arcpy.Point(-111.824706, 40.691896),
arcpy.Point(-111.825592, 40.68703)
])
... View more
09-23-2016
01:12 PM
|
0
|
3
|
898
|
POST
|
import arcpy
array = arcpy.Array([arcpy.Point(0, 0),
arcpy.Point(0, 1000),
arcpy.Point(1000, 1000),
arcpy.Point(1000, 0)
])
polygon = arcpy.Polygon(array)
cursor = arcpy.da.InsertCursor(r'C:\path\to\your\geodatabase.gdb\polygon', ['SHAPE@'])
cursor.insertRow([polygon])
The code below works as expected, but fails if I substitute Lat/Longs in the arcpy.Point. Is that expected?
... View more
09-23-2016
01:00 PM
|
0
|
11
|
1823
|
POST
|
I need to get at the attributes of features, and then generate a derived service from the attributes. I need a scheduled task to read the feature service attributes outside of AGOL/etc, for automated processing.
... View more
09-06-2016
01:55 PM
|
0
|
0
|
588
|
POST
|
I need to get at the attributes of features, and then generate a derived service from the attributes. How do I get at the attributes for each row of a feature service?
... View more
09-06-2016
01:41 PM
|
0
|
0
|
588
|
POST
|
I've got this working to print the description of a feature service, but how do I get a search cursor on a feature service out of AGOL?! I'm new at this arcrest bit! import arcrest un = r'username' pw = r'password' sh =arcrest.AGOLTokenSecurityHandler(org_url='myOrgURL', username=un, password=pw) admin = arcrest.manageorg.Administration(securityHandler=sh) content = admin.content currentUser = content.users.user() fsurl = r'theFeatureServiceURL' fs = arcrest.agol.FeatureService(fsurl,sh) print fs.description
... View more
09-06-2016
11:55 AM
|
0
|
4
|
1661
|
POST
|
Has anyone successfully put a pmf w/ data package on a jump drive? I'm getting broken data sources.
... View more
05-23-2016
10:21 AM
|
0
|
2
|
2070
|
POST
|
With code, it's usually a typo. In this case, it's "Carlos Castaneda" I believe.
... View more
03-24-2016
08:34 AM
|
0
|
0
|
79
|
POST
|
So, I have the wonderful task of briefly looking over census blocks w/ residential zoning for an Emergency Management project. I’m building a search atlas w/ data driven pages, so there will be a map for every block, and I need to clean up the weird polygons. I also need to keep track of what I’ve already QC’d. Here’s a python trick to streamline the process. In my “censusBlocks” feature class I’ve added a field for “hasResidentialZoning” and also “QCd”. I render it by category so QCd = 1 is green, and Null is just an outline. In the python window inside ArcMAP, I run the script below. It builds a list of OID’s where QCd is Null and HasResidentialZoning = 1 and then, inside the python window, when I type “x()” it zooms to the next censusblock and turns it green. In the python window, if I hit the “up arrow” on my keyboard, it pastes in the previous line “x()” and hitting “enter” repeats the process. It’s one move vs. having to select a row in the table, hit zoom-to, right-click the QCd field, field calculate to 1, then select the next row. Boo Carpal Tunnel! I can shut the map down and pick up where I left off. import arcpy mxd = arcpy.mapping.MapDocument('CURRENT') df = arcpy.mapping.ListDataFrames(mxd, "Layers")[0] lyr = arcpy.mapping.ListLayers(mxd, "censusBlocks", df)[0] oids = [] with arcpy.da.SearchCursor("censusBlocks", 'OBJECTID') as c: for r in c: oids.append(r[0]) print len(oids) def x(): n = oids.pop() where = "OBJECTID = " + str(n) +'AND hasResidentialZone = 1 AND QCd IS NULL' arcpy.SelectLayerByAttribute_management(lyr, "NEW_SELECTION", where) df.zoomToSelectedFeatures() arcpy.CalculateField_management(lyr, 'QCd', 1) arcpy.SelectLayerByAttribute_management(lyr, "CLEAR_SELECTION") If you need to modify this for similar repetitive tasks I can lend a hand if needed. Happy mundane QC checks! Kev
... View more
01-28-2016
08:48 AM
|
0
|
0
|
1695
|
POST
|
Exporting a dataframe allows you to set a width/height etc, but I need to include elements outside of the dataframe, but have the page size (6"x6") which is smaller than my printer allows for a page size. How can I export a 5"x5" dataframe surrounded by a 1" margin on all sides for my North Arrow, scale bar, etc? Am I missing something simple? thanks!
... View more
08-17-2015
07:25 AM
|
0
|
1
|
2589
|
Title | Kudos | Posted |
---|---|---|
1 | 02-03-2014 12:02 PM | |
1 | 09-11-2012 12:51 PM | |
1 | 12-09-2014 12:50 PM | |
1 | 12-28-2012 08:28 AM | |
1 | 12-01-2014 01:39 PM |
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:22 AM
|