帖子
|
这里有一些文档,允许您导出关于数据库的任何文件信息。通过python os.path获取文件信息。getatime (path)返回路径最后一次访问的时间。返回值是一个浮点数,给出自epoch以来的秒数(请参阅time模块)。如果文件不存在或不可访问,则引发OSError。os.path。getmtime (path)返回路径最后一次修改的时间。返回值是一个浮点数,给出自epoch以来的秒数(请参阅time模块)。如果文件不存在或不可访问,则引发OSError。在3.6版更改:接受一个类路径对象。 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 .
...查看更多
2周前
|
0
|
0
|
8
|
帖子
|
嗨,我在试图计算列表中给定长度的项目的最接近的倍数集时遇到了这个问题。下面的代码可以工作,但我想看看是否有人有比下面更好的解决方案。N = 12 range = [chr(i) for i in range(65,65 + N)] print (ranges) v = [i+1 for i in range(len(ranges))] print (v) testlist = [[x,y] for x in v for y in v if all([len(v) in [x*y, y*x], x%y > y%x])][-1] print (testlist)
...查看更多
2周前
|
0
|
1
|
205
|
帖子
|
嗨,我有一些关于python中的几何图形的问题。我目前正在编写一个脚本来读取/写入一个特征类的几何,并分析包含方法,以确定是否一条线的中心包含在输入多边形几何中。我的一个问题是,创建一个新的几何对象与读取和利用现有的几何对象之间的区别是什么?Ex: ['SHAPE@']字段读取几何vs多边形(输入,{spatial_reference}, {has_z}, {has_m}),以创建一个新的几何对象。另一个问题是,这能和contains方法一起使用吗还是我需要创建一个全新的对象?任何帮助在这方面将非常感激。
...查看更多
12-13-202206:04我
|
0
|
1
|
155
|
帖子
|
我做编辑版本化的功能类,所以如果是这种情况下,装饰器工作,它会类似于我张贴的例子。
...查看更多
12-06-2022上午09:32
|
0
|
1
|
93
|
的想法
|
这将是简单的,然而你也可以做一些事情更容易:编写一个函数,逆转多线方向上创建一个脚本,然后写一个类来调用任何脚本作为一个模块,可以导入到python库的任何脚本复制和修改几何图形的部分新库复制到包括线反转除了这些建议你必须看看Esri愿意实现你的想法。
...查看更多
12-06-2022上午09:30
|
0
|
0
|
97
|
的想法
|
我遇到过类似的情况,但我处理它的方法是简单地将折线转换为一个点数组,然后使用反向方法来翻转这条线,然后重新创建原始折线。这是我能想到的用几何图形来做的唯一方法。
...查看更多
12-06-202204:48我
|
0
|
0
|
106
|
帖子
|
谢谢@JohannesLindner,我还没有尝试使用编辑关于“with”方法。代码是从Esri文档中复制的,以便在arcpy中编辑。当我尝试使用更新游标时,我将得到一条错误消息,说明数据库需要处于编辑会话中才能运行更新游标。但如果你说的也可以,那我就试一试,因为它的代码行数也更少。
...查看更多
12-06-202203:39我
|
0
|
3.
|
118
|
帖子
|
嗨,我在看关于python的YouTube视频时偶然发现了装饰器的使用,我想可能有一种方法可以利用它来运行更新游标方法,而不必指定多个函数或立即编程。它似乎可以很好地运行这段代码,但我想看看是否有人做过类似的事情。任何例子都将非常感激。# Python代码说明#在Python中带参数的装饰器def decorator(): def inner(func): print('开始编辑进程\n') #开始编辑操作print (f'edit = arcpy.da.Editor({数据库})')print ('edit. da. editor({数据库})')startEditing(False, True)') print ('edit. startoperation ()\n') func() #完成编辑操作print ('edit. stopoperation ()') print ('edit. stopediting (True)\n') print('已完成编辑进程\n') #返回内部函数返回内部@decorator() def my_func():s = ' '*4 print (f'以udpate为游标:{s}') print (f'{s}为游标中的行:')print (f'{s*2}如果{Dictionary}中的行[tile]:') print (f'{s*3}row[tile]=row[tile]') print (f'{s*3}row[shape]={Dictionary}[row[tile]]') print (f'{s*3}row[shape]={Dictionary}[row[tile]]') print (f'{s*3}cursor. updaterow (row)\n')数据库= '收藏\GIS。gdb' Dictionary = 'ATest'
...查看更多
12-05-202212日
|
1
|
5
|
146
|
的想法
|
我相信它已经存在了。我不知道这是否是你想要的,但这里有类似的东西。通过Python实现的Flip Line
...查看更多
12-05-2022上午十一33
|
0
|
0
|
122
|
的想法
|
这里有一些文档,允许您导出关于数据库的任何文件信息。通过python os.path获取文件信息。getatime (path)返回路径最后一次访问的时间。返回值是一个浮点数,给出自epoch以来的秒数(请参阅time模块)。如果文件不存在或不可访问,则引发OSError。os.path。getmtime (path)返回路径最后一次修改的时间。返回值是一个浮点数,给出自epoch以来的秒数(请参阅time模块)。如果文件不存在或不可访问,则引发OSError。在3.6版更改:接受一个类路径对象。 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 .
...查看更多
12-01-202201:13点
|
0
|
0
|
176
|
标题 | 荣誉 | 发布 |
---|---|---|
2 | 08-10-2022上午07:32 | |
1 | 12-05-202212日 | |
1 | 08-30-2022远点 | |
1 | 08-26-202206:25我 | |
1 | 07-06-202205:02我 |