|
POST
|
Try "None" without surrounding quotes (it's also case-sensitive).
... View more
02-12-2018
02:57 PM
|
13
|
0
|
24396
|
|
POST
|
My experience has been there isn't much support for Query Layers in ArcPy. A while back I needed to build a GP tool that would update query layer definitions based on database name/schema changes between Dev, Test and Prod environments, but there doesn't seem to be any support for that kind of thing in ArcPy. (I'm not sure there's even a reliable way to distinguish between query layers and regular EGDB layers in a map document.) Ultimately ended up building the GP tool using ArcObjects, where there are interfaces like IQueryDescription.
... View more
02-12-2018
08:28 AM
|
1
|
0
|
1771
|
|
POST
|
If you're planning on putting the XML into a feature class you should use geoprocessing tools like Create Feature Class and Add Field, then insert records using the arcpy.da.InsertCursor class. If you create your schema through an ODBC connection it won't be a proper feature class as it won't be in the GDB system tables. (Edit: Even if your schema already exists you should still be using the InsertCursor to create records rather than through pyODBC - you can easily insert shapes with an insert cursor, I imagine it's possible using pyODBC but I'm sure it's a lot more difficult, and there are other factors to consider like spatial indexes.)
... View more
02-05-2018
09:26 AM
|
1
|
0
|
3313
|
|
POST
|
Have you built indexes on the fields used in the join?
... View more
02-02-2018
02:58 PM
|
1
|
0
|
1686
|
|
POST
|
It's not a Python function, it's an Oracle function that's executed by the database when the cursor is created. No need to import anything on the client/Python side.
... View more
01-30-2018
03:50 PM
|
0
|
0
|
2223
|
|
POST
|
I'm not sure of the Oracle date function (don't often work with it) but there should be a DB "current date" function you can use as part of the cursor's where clause. A quick search says it's sysdate and you can use integer operators on it, so you could do something like this (theoretically, I can't test it): with arcpy.da.SearchCursor(fc, "*", "LastUpdates > SYSDATE - 30") as cursor:
for row in cursor:
# Do stuff I've used this kind of where clause as Definition Expressions (albeit SQL Server equivalent), can't see why it wouldn't work as a cursor's where clause.
... View more
01-30-2018
03:38 PM
|
1
|
3
|
2223
|
|
POST
|
What kind of data source are you working with - File GDB, Shapefile, SQL Server, Oracle, etc.?
... View more
01-30-2018
03:27 PM
|
0
|
5
|
2223
|
|
POST
|
If I understand correctly this might do the trick in the field calculator... In the Pre-Logic Script Code try this: projectCounts = {}
def getCount(project):
if not project in projectCounts:
projectCounts[project] = 0
projectCounts[project] += 1
return projectCounts[project]
And in the textbox below set Count1 = getCount(!ProjectName!)
... View more
01-16-2018
10:55 AM
|
0
|
1
|
982
|
|
POST
|
Using the Python interpreter, import the regular expression module (re) in the pre-logic script code block (click on Show Codeblock to open this): import re Then use a substitution along the lines of this: re.sub(r"\([^\)]+\)", "", !ServiceAddr!) Should work fine with multiple pairs of parentheses but will likely need to be tweaked if you've got nested pairs.
... View more
01-16-2018
08:53 AM
|
1
|
3
|
3685
|
|
POST
|
I've used ET GeoWizards' "Create Centerlines" tool to do this with some success, but it has a few drawbacks: It dissolves adjacent polygons, so to get true centrelines I had to run the tool once per feature by first extracting each individual feature to a new class, then merging all of the output classes. (The tool didn't seem to honour layer selections when I used it @ GeoWizards version 11.2 for ArcGIS 10.3). For polygons that have an ambiguous direction, the centreline usually comes out as a multi-part polyline shaped like the letter X. The centrelines seem to veer off randomly to one side toward the end of some (maybe 5-10%?) of the polygons.
... View more
11-22-2017
09:11 AM
|
1
|
0
|
6821
|
|
POST
|
From the doc: "DISTINCT, ORDER BY, and ALL are only supported when working with databases. They are not supported by other data sources (such as dBASE or INFO tables)." Since shapefiles use dBASE tables to store attributes, ORDER BY won't work on shapefiles.
... View more
11-20-2017
12:48 PM
|
3
|
0
|
1682
|
|
POST
|
Using ArcObjects and VB.NET you could build an application extension that would listen to editor events, or a geodatabase class extension that listens to object class events. Neither are very simple tasks however, and there are drawbacks to each, particularly class extensions (anyone accessing the data must have the extension's DLL installed, for example). Editor Events doc: ArcObjects 10 .NET SDK Help Class Extension doc: ArcObjects 10 .NET SDK Help So... It's possible, but I wouldn't recommend it unless you have a very compelling reason not to just use the field calculator.
... View more
11-20-2017
11:36 AM
|
1
|
0
|
2559
|
|
POST
|
I haven't tried this with AGOL data, but getSelectionSet() on the arcpy.mapping.Layer class might be worth a look.
... View more
11-07-2017
12:25 PM
|
0
|
6
|
2365
|
|
POST
|
Is a link to the generated JSON file presented to users as an HTML anchor, similar to how download links are displayed in the JSAPI's Print Widget? If so you could add the download attribute to the anchor tag: HTML a download Attribute
... View more
10-20-2017
01:42 PM
|
0
|
1
|
1222
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 03-02-2018 08:44 AM | |
| 1 | 02-02-2018 02:58 PM | |
| 1 | 04-17-2018 07:53 PM | |
| 1 | 05-01-2018 01:24 PM | |
| 1 | 02-05-2018 09:26 AM |
| Online Status |
Offline
|
| Date Last Visited |
11-11-2020
02:24 AM
|