|
POST
|
It's always been a mystery to me; I thought at one time it was by ascending value in ObjectID. Seems like friend and colleague @JoshuaBixby provided an explanation at one time...
... View more
10-19-2021
07:09 AM
|
0
|
1
|
2575
|
|
POST
|
Good for you for sticking with it. I have to ask, what is it that geopandas offers that is worth that much trouble?
... View more
10-19-2021
07:02 AM
|
0
|
1
|
5941
|
|
POST
|
I'm glad it worked for you. For me, I much prefer to use an update cursor than the field calculator in this kind of situation. With respect to retirement, it's in the very near future for me, so ask away!
... View more
10-18-2021
11:56 AM
|
0
|
0
|
1227
|
|
POST
|
Here is how I ended up doing it with an update cursor: import arcpy
table = r'C:\GIS\Forbuss\Forbuss.gdb\ForbussDataTable'
nameTable = r'C:\GIS\Forbuss\Forbuss.gdb\ForbussDataTable_Statistics'
nameList = [r[0] for r in arcpy.da.SearchCursor(nameTable,'basin_name','basin_name IS NOT NULL') ]
arcpy.management.MakeTableView(table,'tableView')
for name in nameList:
select = f"basin_name = '{name}'"
fields = ['description','basin_name']
with arcpy.da.UpdateCursor('tableView',fields,select) as cursor:
rec = 0
for row in cursor:
rec+=1
row[0] = (f'{row[1]}{str(rec).zfill(4)}')
cursor.updateRow(row) Lines 3,4 & 5 set the stage; I converted your csv into a fgdb table, and then using list comprehension and a search cursor, created a list of basin names (where the basin name is not null). Then in Line 7 I turn the original table into a table view since I'm running this as a stand alone script. Finally at row 9 I iterate through the list of basin names and with an update cursor update the 'description' field.
... View more
10-18-2021
10:24 AM
|
3
|
2
|
11886
|
|
POST
|
I'm not a fan of using the plus sign for concatenating strings, and really prefer the f string method Here is an example: rec = 0
for i in range(1,10):
print(f'MH{str(i).zfill(4)}')
Without seeing your entire code block, it's hard saying what the syntax error might be. Can you include a sample of your data in csv form?
... View more
10-18-2021
08:28 AM
|
0
|
0
|
11897
|
|
POST
|
I was working on the latest census data this past week. Your spreadsheet is treating the GEOID as number; I thought that in the census data they are strings. At any rate, what is the geoid10 you are referring to?
... View more
10-15-2021
03:37 PM
|
0
|
1
|
2093
|
|
POST
|
You can use that for a start and build it into a cursor. Otherwise you'll be stuck running it iteratively by hand. Assuming you have several different prefixes, you'll probably need to work through a list of them, and plug that value as your prefix and then concatenate the number you want. It's late friday afternoon and I've got my eye on a cold adult beverage. Do some hacking and if you need a hand, post it up on monday.
... View more
10-15-2021
03:29 PM
|
0
|
0
|
11954
|
|
POST
|
The best I can find is here in the help pages, and it's not that much help at all. There are times when ESRI just doesn't expose properties to arcpy as we would like them to.
... View more
10-15-2021
03:19 PM
|
1
|
0
|
1080
|
|
POST
|
To go through the individual records you are going to need an update cursor. I'm not sure why you are using a global variable designator. There really is no need to and there a lot of pythonistas that frown upon their use.
... View more
10-15-2021
03:11 PM
|
0
|
1
|
11958
|
|
POST
|
Just my two cents when it comes to feature datasets in the enterprise (sde) environment: In the past I have always avoided using FDS in that environment. They have a tendency to misbehave with the multi editor functionality having schema locks at the worst time. The EGDB (sde) is great when it comes to editing and data storage, and I've used it as such for many years. However, if you have special needs like a streets network that requires a fds, I recommend storing and editing the data in your EGDB as feature classes, and then create a workflow to push them to a FDS within a file geodatabase. One such workflow that I've used is to truncate the FGDB/FDS feature classes and then append the EGDB-feature classes accordingly.
... View more
10-15-2021
11:29 AM
|
0
|
0
|
10391
|
|
POST
|
I've never been able to get a scheduled task to execute properly from a desk top computer; only a server. These other responses sound like great suggestions.
... View more
10-14-2021
10:05 AM
|
0
|
0
|
1632
|
|
POST
|
Darn. Clones can be a pain but to expand on what @DonMorrison1 suggests, here is my method. First of all, I suggest you upgrade to at least 2.7.4. As I mentioned I've experienced problems at 2.8 as well as 2.8+ so I'm using 2.7.4 myself Cloning: Open ArcGIS Pro; down at the lower left corner you'll see the Settings 'gear' icon. (Don't bother opening a project per se, just Pro). Click on Settings and on the left panel, click Python. At this point you'll see your active environment. Notice below that I create a a specific target folder as well as naming convention for my clones: I like to put my clones where I can find them rather than burying them where ArcGIS Pro does. Assuming you have a target directory, let's set about cloning your Default Environment. Click on Manage Environments, and when presented with the Manage Environments pane, activate the the Default Environment with a single click. On the right side of the pane, is the Clone column; single click on the icon next to your default environment and you are presented with another pane that allows you to name your clone as well as put where you want it: Click OK and let it do it's thing... Single click on the new clone and click OK to activate. Close ArcGIS Pro: This is where my method is going to slightly change from @DonMorrison1 ... Installing Spyder: Using your Windows Start button, navigate to the ArcGIS folder and select Python Command Prompt. It will be the new clone: Personally I don't care for the ArcGIS Pro Package manager and prefer to use a Conda install for any custom installation of packages. Click here for a Conda Command Cheat Sheet. I use this command for Spyder: Again, let it do the mojo.... You'll get a Proceed ([y]/[n]) prompt: answer y. More bumping and grinding; be patient it may toss some warnings and other messages. Just let it go. Once you return to the command line, type in spyder and see what what happens. I actually ended up with Spyder 5.0.4 because the 'channels' I go through didn't provide 5.0.5, but that's no big deal. You can always just update when you Spyder fires up.
... View more
10-14-2021
08:11 AM
|
0
|
0
|
5947
|
|
POST
|
What version of ArcGIS Pro are you using? 2.8 has a history of being problematic with clones where you think your clone is active, in reality it is not.
... View more
10-12-2021
03:07 PM
|
0
|
2
|
5977
|
|
POST
|
Try removing the data from your project and then add it back in. I'm not sure what is going on, but it seems like a caching issue. You can go into the Options pane and check your cache there as well and clear it manually. Here is a shot of mine, and I might want to clear it...
... View more
10-12-2021
11:05 AM
|
1
|
1
|
1996
|
|
POST
|
Don't mess around with trying to figure out what files within a fgdb go with what feature class. You'll soon go mad. I don't quite understand why you are seeing the internal files of a fgdb in arc catalog.
... View more
10-11-2021
12:50 PM
|
0
|
0
|
4607
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 10-11-2018 07:12 AM | |
| 1 | 05-17-2021 11:18 AM | |
| 1 | 06-29-2021 11:42 AM | |
| 1 | 07-05-2012 07:49 AM | |
| 1 | 09-03-2016 06:16 AM |
| Online Status |
Offline
|
| Date Last Visited |
3 weeks ago
|