|
POST
|
Joe, I also have ArcGIS Desktop 10.4 installed and Python 2.7. I can't figure out how to create/test code for Python3 using the packages/env installed by ArcGIS Pro.
... View more
06-20-2018
11:14 AM
|
0
|
2
|
3080
|
|
POST
|
Thanks, Dan. So I'll need to download Anaconda and Spyder to interact with the Python3 packages Pro installed?
... View more
06-20-2018
07:41 AM
|
0
|
4
|
3080
|
|
POST
|
I'm currently in the process of writing/testing scripts with Python3 to be used as Python Scripts Tools with ArcGIS Pro. I am confused with the Python stack installed with ArcGIS Pro 2.1. It seems like there is no IDLE- is this true? Also, if Anaconda comes installed with Pro- how can I create scripts with Python3 to be used in that environment? Do I need to download Python3 outside of the ArcGIS Pro stack? I have downloaded Sublime3 and downloaded Conda within it via the steps outlined here. But, I still do not know how to test scripts within it that point to the installed packages in the Pro directory. What is your process of creating/testing scripts to be used with the installed Python3 packages with ArcGIS Pro? I am very confused and any suggestions or documentation would be greatly appreciated.
... View more
06-20-2018
07:00 AM
|
0
|
18
|
6291
|
|
POST
|
See here for reference: SQL reference for query expressions used in ArcGIS—ArcGIS Pro | ArcGIS Desktop Is the field you're trying to query a Date type? Have you tried just using ArcMap and 'Select By Attributes' tool to see what the unique values are.
... View more
05-22-2018
08:06 AM
|
2
|
0
|
1913
|
|
POST
|
Nope, not that I can find. Could you try to replicate the error on some dummy data?
... View more
05-02-2018
07:46 AM
|
0
|
1
|
1653
|
|
POST
|
We're in the process of moving from ArcGIS Desktop 10.4 to ArcGIS Pro, so the files were created with 10.4. The message above will pop up and then we'll refresh the directory and the shapefile will be gone.
... View more
05-02-2018
05:37 AM
|
0
|
3
|
1653
|
|
POST
|
Has anyone else experienced accidentally dragging and dropping a shapefile on top of another shapefile (or the same shapefile) and having it be deleted? We have currently been experimenting with ArcGIS Pro 2.1.2 and this has been replicated throughout our organization. See error message below.
... View more
05-01-2018
01:01 PM
|
0
|
6
|
1836
|
|
POST
|
This is a quick/dirty way to do it. I'm sure there is a more elegant way. lyr = "C:\Temp\Default.gdb\CurrntRoadNamesTableTest_1"
preDir = ['N ','S ','E ','W ']
#for field in arcpy.ListFields(lyr, "*", "String"): <- i don't know why you need this
with arcpy.da.UpdateCursor(lyr, ['STREET']) as cursor: #since you're specifying field in cursor item
for row in cursor:
if row[0][:2] in preDir:
row[0] = row[0][2:]
cursor.updateRow(row)
del cursor
... View more
04-12-2018
08:20 AM
|
2
|
5
|
1906
|
|
POST
|
Change the inputDir path to the directory that houses your geodatabases...
... View more
04-04-2018
01:10 PM
|
1
|
0
|
1329
|
|
POST
|
To add onto the concepts covered by @James, the following will take an input directory and loop over the gdbs and FCs for each one. import arcpy
import os
inputDir = r'path\to\directory\that\houses\geodatabases'
ext = ['.mdb','.gdb']
gdbs = [x for x in os.listdir(inputDir) if x[-4:] in ext]
for g in gdbs:
fullpath = os.path.join(inputDir, g)
arcpy.env.workspace = fullpath
for fc in arcpy.ListFeatureClasses():
rowCount = arcpy.GetCount_management(fc)[0]
if rowCount == '0':
print "Deleting empty FC: {0}".format(os.path.join(g,fc))
arcpy.Delete_management(os.path.join(fullpath,fc))
else:
print "{0} contains {1} records".format(os.path.join(g,fc), rowCount)
... View more
04-03-2018
07:01 AM
|
1
|
3
|
1329
|
|
POST
|
If you put something like this into the 'Pre-Logic Script Code' of the Field Calculator tool, it may work. def calc(field1, field2, field3):
if len(str(field3)) == 1:
return ("{0}{1}-00{2}".format(field1,field2,field3))
if len(str(field3)) == 2:
return ("{0}{1}-0{2}".format(field1,field2,field3))
if len(str(field3)) == 3:
return ("{0}{1}-{2}".format(field1,field2,field3))
... View more
03-29-2018
11:40 AM
|
0
|
0
|
3854
|
|
POST
|
First - I had a syntax error in my original reply. It has been edited, please try that one. Second - Click the three eellipses when writing the response -> click 'More' -> 'Syntax Highlighter'
... View more
03-15-2018
08:54 AM
|
3
|
1
|
3265
|
|
POST
|
You should use the in python function to see if the value of the row you're iterating over is found in the list. See below for an example. Note: make sure to convert the values to a string before comparing (row 10), since the values in the deletedValues list are strings. import arcpy
dataset = r'path\to\dataset.shp'
deleteValues = ['1','2','3']
cursor = arcpy.da.UpdateCursor(dataset, ['FIELD'])
for count, d in enumerate(cursor):
if str(d[0]) in deleteValues:
cursor.deleteRow()
del cursor
print '{0} rows were deleted.'.format(count)
... View more
03-15-2018
08:20 AM
|
1
|
3
|
3265
|
|
POST
|
So it looks like 'version.name.split(".")[0]` is returning the [Owner] name and not the [Name]. That's strange... What happens it you tried printing the entire version.name? print "Target: {0}".format(versionName)
for version in arcpy.da.ListVersions(sdeConnection):
print "Found - {0}".format(version.name)
## if version.name.split(".")[0] == versionName:
## print(userVersion)
## versionFound = True
## break
... View more
02-21-2018
10:52 AM
|
0
|
1
|
6304
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 02-28-2024 11:43 AM | |
| 1 | 09-12-2025 07:32 AM | |
| 1 | 10-26-2018 06:50 AM | |
| 1 | 10-26-2018 08:43 AM | |
| 1 | 02-25-2016 07:50 PM |
| Online Status |
Offline
|
| Date Last Visited |
3 weeks ago
|