|
POST
|
Python has conditional expressions, a.k.a., ternary operators, that can be used in situations like this one. Using a ternary operator eliminates the need for using a code block and defining a function. -1 if !FieldA! == 0 else !FieldB!
... View more
09-14-2015
02:02 PM
|
2
|
2
|
2317
|
|
POST
|
Can you provide an real-world example, or illustrative example, of a polyline and what the expected outcome would be? Unfortunately, this is a case where the weaknesses of the ArcPy Geometry classes really show throw. Other Python geometry libraries/packages like GeoDjango and Shapely offer more functionality at the geometry level. For example, ArcPy Geometry classes don't offer a simple/is_simple functionality to tell whether a linestring is simple or complex, which would be helpful in this case at determining whether a line either crosses or overlaps itself. I may be able to offer additional feedback if I have a specific example to work with.
... View more
09-14-2015
01:06 PM
|
0
|
9
|
4022
|
|
POST
|
Marc Cusumano, I did read your original post, hence the comment you are mixing up the two different workflows. See Asrujit SenGupta's recent post for some great tips if you are still having problems.
... View more
09-14-2015
08:24 AM
|
0
|
0
|
5099
|
|
POST
|
Looking at the documentation that Asrujit SenGupta links to: Edit the Default Version You can use SQL to connect to the Default version and edit a versioned view. You do not need to open an edit session. When you start editing, you are automatically connecting to the current state of the Default version. .... Switch from editing a named version back to editing Default If you need to go back to editing the Default version directly—for example, if your manager tells you other users at your site need to see a particular edit immediately—you can execute version_user_ddl.set_default to switch back to editing the Default version. The edits you make to the Default version can be seen by other users connected to Default as soon as they refresh their client connections. You are mixing the workflows for editing the Default version and editing named versions. If you want to edit Default directly, you do not need to create a named version.
... View more
09-12-2015
07:20 AM
|
0
|
4
|
5099
|
|
POST
|
The "vw" in the suffix gives the strong impression those are views being created and not tables. Although you provide the general steps you are taking, they are still too general for others to provide much feedback. With the 4 steps you lay out, can you isolate which step is creating the tables/views? If so, what specific step (function call, task, etc...) is creating them?
... View more
09-11-2015
06:34 AM
|
1
|
0
|
1027
|
|
POST
|
You are close. The Get Count tool, like most geoprocessing tools, returns Result objects. Assuming you don't get any errors, the following should work: res = arcpy.GetCount_management(dataset)
int(res.getOutput(0))
... View more
09-10-2015
01:34 PM
|
1
|
0
|
2456
|
|
POST
|
Since your comparison interval isn't weeks, months, or greater, I don't think EsriTimeDelta is necessary in this case, but you could go that route if the interval may get that large. If you simply want to compare a row's datetime with the previous row's datetime, something like this should work: table = 'b3514str133'
date_field = "INP_DATE"
interval = datetime.time(1) #specify 1-hour interval
with arcpy.da.SearchCursor(table, date_field) as cursor:
previous, = next(cursor)
for dt, in cursor:
if dt - previous <= interval:
print row
previous = dt If you want to compare a row's datetime with all previous rows' datetimes, or all rows' datetimes, then the situation gets more involve
... View more
09-09-2015
03:25 PM
|
1
|
0
|
1337
|
|
POST
|
If you haven't already, it might be worth checking out the Overview of copying geodatabases documentation, it covers a few different ways of getting data in bulk out of geodatabases. A note of caution, one of the links is incorrect and redirects you to another link. See the ArcGIS 10.2.x Help for Copying a geodatabase using the Copy tool.
... View more
09-09-2015
02:34 PM
|
1
|
0
|
1386
|
|
POST
|
Try this code, see if: 1) it works, and 2) it gives the results you want: import arcpy, os
arcpy.env.workspace = r'D:\transfer\geodata'
for shp in arcpy.ListFiles('*.shp'):
root, ext = os.path.splitext(shp)
new_root = root.replace('.','_')
if new_root != root:
arcpy.Rename_management(shp, new_root + ext)
... View more
09-08-2015
07:38 AM
|
1
|
0
|
5485
|
|
POST
|
Your stripping the file extensions off of the files, so ArcGIS Desktop won't see them anymore as shapefiles because the files don't have the proper file extensions. Although I am a big fan of using native Python tools instead of ArcPy tools, sometimes the ArcPy tools work best. In this case, I recommend using the Rename tool because it will take care of renaming all the associated/related shapefile files along with the SHP file.
... View more
09-08-2015
07:17 AM
|
1
|
2
|
5485
|
|
POST
|
Was there a tool in ET GeoWizards that did what you want? If so, what tool? Knowing the tool may help us understand what you are trying to accomplish without ET GeoWizards.
... View more
09-03-2015
08:32 AM
|
0
|
0
|
1033
|
|
POST
|
Can you be more specific about your situation? What version of ArcGIS Pro? What version of SQL Server? What database client and version? Are you connecting to an ArcSDE geodatabase or SQL Server data that isn't in a geodatabase?
... View more
09-02-2015
07:05 PM
|
0
|
1
|
1107
|
|
POST
|
wil waters, don't misconstrue what I am about to say as defending Esri, I have ground many axes into sledgehammers fighting their business processes and development practices over the years, but developing a new application like ArcGIS Pro isn't quite as simple as you suggest. To answer your first question, i.e., why not put everything that works in existing software into Pro and add onto that, users like you and I wouldn't see ArcGIS Pro for another couple years. ArcGIS Pro was mostly a ground-up rewrite, which is a good thing in many ways because it allows some development baggage from over the years to be left behind. Taking functionality from ArcMap, ArcScene, etc... and putting it into ArcGIS Pro isn't just porting code over, it is redesigning or reengineering it in most cases. It took more than a decade to get ArcGIS Desktop to where it is today, I don't think most customers want to wait even half that long before seeing ArcGIS Pro for the first time. Given Esri is a private company with a billionaire at the top, one could counter my previous statement by saying this is more about money than effort since money can pay for more developers. There may be some truth in that suggestion, but the reality is business people don't become billionaires by spreading copious amounts of money around, which brings us back to prioritization of limited resources. Everyone thinks the functionality he/she uses is the most important in the software. I have never understood the organizational politics or decision making processes of how Esri determines what features get implemented when, so I can't offer a guess as to why this statistics functionality is still absent.
... View more
09-01-2015
06:28 AM
|
6
|
1
|
6033
|
|
POST
|
How are you coming up with r'Database Connections\Connection to server.sde' ? Is this string being returned to you from some code? Are you seeing it in a dialog box somewhere? Are you looking at the name in ArcCatalog under the Database Connections folder? I ask these questions because the only way for your workspace check code to return False is if the SDE file doesn't exist or you don't have permissions to access it.
... View more
08-31-2015
07:38 AM
|
0
|
0
|
2653
|
|
POST
|
Try adding some print statements to see what layer causes the code to hang. If you change the order of the problem layer, does the code still hang on that layer?
... View more
08-31-2015
07:16 AM
|
1
|
4
|
1277
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | a week ago | |
| 2 | 3 weeks ago | |
| 1 | 3 weeks ago | |
| 2 | 06-05-2026 10:30 AM | |
| 1 | 05-29-2026 08:22 AM |
| Online Status |
Offline
|
| Date Last Visited |
11 hours ago
|