|
POST
|
I do edit versioned feature classes so if that's the case, would a decorator work and would it be similar to the example that I posted.
... View more
12-06-2022
09:32 AM
|
0
|
1
|
2107
|
|
IDEA
|
That would be simpler, however you could also do a couple of things to make it easier: Write a function that reverses the polyline direction Create a script and write it a class to then be called by any script as a module that can be imported into any script Make a copy of the python library and modify the geometries portion of the newly copied library to include the line reversal Aside from those suggestions you would have to see if Esri would be willing to implement your idea.
... View more
12-06-2022
09:30 AM
|
0
|
0
|
3877
|
|
IDEA
|
I've ran across something similar, but the way I've handled it was to simply convert the polyline into an array of points and then use the reverse method to basically flip the line and then recreate the original polyline. That's the only method I can think of that will do that using the geometries.
... View more
12-06-2022
04:48 AM
|
0
|
0
|
3886
|
|
POST
|
Thanks @JohannesLindner, I haven't tried using edit in regards to the "with" method. The code was copied from the Esri documentation for editing in arcpy. When I have tried to use the update cursor, I would get an error message stating that the database needs to be in an edit session before the update cursor could run. But if what you say also works, then I'll give that a try instead since it's also fewer lines of code.
... View more
12-06-2022
03:39 AM
|
0
|
3
|
2132
|
|
POST
|
Hi, I came across the use of decorators while watching YouTube videos on python, and I thought that there might be a way to utilize this to run the update cursor method without having to specify multiple functions or program it right off the bat. It seems to run this segment of code just fine, but I wanted to see if anyone else has done anything like this. Any examples that would be greatly appreciated. # Python code to illustrate
# Decorators with parameters in Python
def decorator():
def inner(func):
print ('Starting edit process\n')
# Start edit operation
print (f'edit = arcpy.da.Editor({Database})')
print ('edit.startEditing(False, True)')
print ('edit.startOperation()\n')
func()
# Finish edit operation
print ('edit.stopOperation()')
print ('edit.stopEditing(True)\n')
print ('Finished edit process\n')
# returning inner function
return inner
@decorator()
def my_func():
s = ' '*4
print (f'with udpate as cursor:{s}')
print (f'{s}for row in cursor:')
print (f'{s*2}if row[tile] in {Dictionary}:')
print (f'{s*3}row[tile]=row[tile]')
print (f'{s*3}row[shape]={Dictionary}[row[tile]]')
print (f'{s*3}cursor.updateRow(row)\n')
Database = 'AFavorites\GIS.gdb'
Dictionary = 'ATest'
... View more
12-05-2022
11:50 AM
|
1
|
5
|
2160
|
|
IDEA
|
I believe it already exists. I don't know if this is what you are looking for but here is something akin to it. Flip Line via Python
... View more
12-05-2022
11:33 AM
|
0
|
0
|
3902
|
|
IDEA
|
Here is some documentation that will allow for you to export any file information regarding the database. Get file information via python os.path.getatime(path) Return the time of last access of path. The return value is a floating point number giving the number of seconds since the epoch (see the time module). Raise OSError if the file does not exist or is inaccessible. os.path.getmtime(path) Return the time of last modification of path. The return value is a floating point number giving the number of seconds since the epoch (see the time module). Raise OSError if the file does not exist or is inaccessible. Changed in version 3.6: Accepts a path-like object. os.path.getctime(path) Return the system’s ctime which, on some systems (like Unix) is the time of the last metadata change, and, on others (like Windows), is the creation time for path. The return value is a number giving the number of seconds since the epoch (see the time module). Raise OSError if the file does not exist or is inaccessible. Changed in version 3.6: Accepts a path-like object. os.path.getsize(path) Return the size, in bytes, of path. Raise OSError if the file does not exist or is inaccessible. Changed in version 3.6: Accepts a path-like object.
... View more
12-01-2022
01:13 PM
|
0
|
0
|
6169
|
|
POST
|
Thank you jcarlson. I have read the documentation for the different authentication methods but I have yet to figure out how to configure the script using that documentation. This might also be a fairly big security risk, but if there is a way to have them sign in automatically would be really helpful.
... View more
11-02-2022
04:37 PM
|
0
|
0
|
2692
|
|
POST
|
Hi, I am trying to configure my script to be able to request the user to sign into the portal, but the issue that I am facing is that the portal is set up using single sign. Is there a way to configure the script to require the user to sign in with a simple click of a button prompt like how we have it set currently or does it have to be manually configured every time? I have a script written for AGO which works fine, but is set up with the credentials stored manually.
... View more
10-31-2022
09:38 AM
|
0
|
2
|
2738
|
|
POST
|
Thanks @TonyContreras_Frisco_TX, It is a new role that we are looking to have installed with the next portal upgrade that is coming up. I was just curious to see if it could be installed on the same machine, in a sense. I will let the manager know what I have found. I have been doing some research into it but I wanted to check with the community as well to see if I could potentially get more insight into it.
... View more
09-06-2022
10:17 AM
|
0
|
0
|
1810
|
|
POST
|
Hi, I just have a general question, if anyone knows the answers, if the Notebook Server can be installed on top of another server? We are looking to have it installed but I was tasked with finding out whether or not we can install it with another server on the same machine. Any help on this would be greatly appreciated.
... View more
09-06-2022
08:36 AM
|
0
|
3
|
1818
|
|
POST
|
Hi @Andres, Can you post a snippet of your script where you think problems are occurring? It would be difficult to help you if nobody can see where the issue lies.
... View more
09-06-2022
08:07 AM
|
0
|
1
|
2041
|
|
POST
|
I was thinking of doing just that. I wanted to double check to see if it was already pre-existing in the current set of libraries. Thanks @ShaunWalbridge for letting me know.
... View more
08-30-2022
10:01 AM
|
1
|
0
|
2275
|
|
IDEA
|
Hi, I came across the FloPy module when I was looking for ways to use Computational Fluid Dynamics (CFD) for a project. It seems like it isn't natively included, but I think it would be extremely useful, especially for the utility industry, if it were included.
... View more
08-26-2022
06:25 AM
|
1
|
3
|
2130
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | Tuesday | |
| 1 | 05-07-2026 01:36 PM | |
| 1 | 02-10-2026 06:09 AM | |
| 1 | 03-04-2026 01:08 PM | |
| 1 | 02-24-2026 12:59 PM |
| Online Status |
Offline
|
| Date Last Visited |
yesterday
|