我有一个脚本,它从MSSQL数据库中获取一个表,然后将其注册到ArcGIS中。它还使用了其他几种arcpy方法。我试图将它与Flask结合起来,并开发了一个HTML接口,您可以在其中指定表。脚本在控制台上运行得非常好,但是,当在http://127.0.0.1:5000/上使用Flask运行时,arcpy函数不运行,然后应用程序抛出错误。在
我使用的是本地python目录,因此在flask上导入arcpy没有任何问题。所以,我可以使用pymssql函数创建一个新的表,但是当涉及到arcpy函数时,它抛出不存在错误,但是,表存在。我觉得用烧瓶跑arcpy有点不对劲,但任何帮助都将不胜感激。在
(2)我在Django也尝试过同样的方法,但我遇到了同样的问题。在
谢谢
class createGISLayer(FlaskForm):
tCreateLayer = SubmitField('Create GIS Layer')
if formCreate.tCreateLayer.data and formCreate.validate_on_submit():
if myLayer is not None:
try:
print("Create GIS Layer")
myLayer.dashboardMain()
flash('GIS Layer created!', 'success')
except Exception as e:
print(e.message)
flash(e.message, 'danger')
<!-- Create GIS Layer -->
<div class="content-section">
<form name='idCreateGISLayer' action="" method="POST">
<table style="height: auto; margin-left: auto; margin-right: auto; width: 600px;">
<tbody>
<tr>
{{ formCreate.hidden_tag() }}
<td style="height: 39px; width: 259px">
<h2 style="text-align: left;"><font size="3"><strong>(2) Create </strong></font></h2>
</td>
<td style="text-align: left; height: 39px;">
<div class="auto-style2">
{{ formCreate.tCreateLayer(class="btn btn-outline-info")}}
</div>
</td>
</tr>
</tbody>
</table>
</form>
</div>
Table Created.
F:\Projects\Dashboard\Publish.sde\Publish.dbo.A_WebT1
"F:\Projects\Dashboard\Publish.sde\Publish.dbo.A_WebT1" does not exist
我没有调用函数,而是用DOS运行脚本。在
相关问题 更多 >
编程相关推荐