
Python
关中山水郎
这个作者很懒,什么都没留下…
展开
-
Linux搭建QGIS插件库
README.md · master · GIS projects by Michel Stuyts / phpQGISrepository · GitLab下载phpQGISrepository-master.tar.gz安装docker-composecd 到文件目录下如果没有php-apache:7.3镜像包,找个有网的地方拉取一下https://registry.io/v2载入镜像docker load -i php-apache7.3.tardocker images原创 2022-02-19 16:14:47 · 864 阅读 · 1 评论 -
pyqt去掉按钮初始焦点
把所有按钮focusPolicy属性设置为NoFocus就行了原创 2022-02-09 15:22:56 · 759 阅读 · 0 评论 -
PostGIS安装
1首先安装PostgreSQL ,安装完后 services.msc打开服务列表,找到postgresql-x64-14启动,如果启动不了,设置本地系统账户登录2打开pgAdmin4,创建服务器参数设置可以参考帮助文档3安装postgis,下载地址Index of /postgis/windows/pg10/选择create spatial database选择PostgreSQL安装目录 C:\Program Files\PostgreSQL\14...原创 2021-12-31 18:07:12 · 5888 阅读 · 0 评论 -
Arcgis python要素折点转点
#coding=utf-8 #适应中文import osimport arcpyfrom arcpy import env# Set environment settingsenv.workspace = "E:/test/测试数据"# Set local variablesinFeatures = "2345.shp"outFeatureClass = "E:/测试数据/test_FeatureVertic1"# Execute FeatureVerticesToPointsa.原创 2021-12-14 10:50:12 · 1221 阅读 · 0 评论 -
Python风向切面均匀提取风轨迹线
暂时没有图,思路就是,计算总风向的切面,根据切面所在的函数,求切面的长宽高(坐标点三角函数),传入需要提取线数的N值,由于等分矩阵y=x^2,所以递归切割面,当y>n时,提取集合前n条线,同时在切割面中取起伏最大的一条线def UniformExtractLines(listLines , OutLines, WindDirection): list_xyz = GetlinesLastPointList(listLines) #风向向量 vq=getAngel_xy(W原创 2021-05-20 11:57:23 · 368 阅读 · 0 评论 -
Creating an ndarray from ragged nested sequences (which is a list-or-tuple of lists-or-tuples-or nda
python报错VisibleDeprecationWarning: Creating an ndarray from ragged nested sequences (which is a list-or-tuple of lists-or-tuples-or ndarrays with different lengths or shapes) is deprecated. If you meant to do this, you must specify 'dtype=object' when原创 2021-05-10 12:22:05 · 9341 阅读 · 0 评论 -
Python提取众多曲线中起伏最大的前N条线
在做GIS数据处理时,从众多曲线中提取数十条起伏明显的线,方便展示,python代码如下:参数依次为线集合(线线包括点),高程所在列,提取的线数量def getElevationUpsAndDownstop(list,heightNumber,LineNumber): newlist=[] for x in list: array_All = np.array(x) pointMax = max(array_All[:, heightNumber..原创 2021-05-10 11:55:48 · 410 阅读 · 0 评论 -
python生成json
video_D = defaultdict(list) for i in range(len(list_All)): video_M = defaultdict(list) video_M["va"] = list_All[i][0], list_All[i][1], list_All[i][2] video_M["ot"] = list_All[i][3], list_All[i][4], list_All[i][5.原创 2021-05-07 14:13:26 · 462 阅读 · 0 评论 -
Python求风向xy向量
这个图,对应的笛卡尔平面坐标系:原点在圆心,x正方向指向东,y正方向指向北根据上图,可以知道12.5度的角度位置,箭头的方向是指向圆心的,这样就能确定了箭头在笛卡尔坐标系的指向比如:入流风向为0,箭头方向指向圆心,就是说箭头是一个向下的;入流风向为90,箭头方向指向圆心,也就是说箭头是向左的代码def getAngel_xy(correctAngel): x=0 y=0 if correctAngel> 0 and correctAngel <90: ..原创 2021-05-06 16:06:57 · 8328 阅读 · 0 评论 -
Python cos 90 不为零
因为弧度转换有精度缺失,所以python中 math.cos(math.radians(90))会有很小很小的误差,很接近于零,这个时候保留小数点位数取就行了。原创 2021-05-06 12:02:23 · 1324 阅读 · 0 评论 -
python安装pandas失败
如图安装语句改为pip --default-time=100 install pandas原创 2021-04-20 16:12:00 · 914 阅读 · 1 评论 -
python gdal 打包后运行exe Error:cannot find proj.db
如图这是因为打包后没有配置环境变量代码中添加import osimport sysos.environ['PROJ_LIB'] =r'E:\PythonStart\DataProcess\venv\Lib\site-packages\osgeo\data\proj' #os.path.dirname(sys.argv[0])重新打包即可原创 2021-04-17 12:20:24 · 2414 阅读 · 7 评论 -
Python打包exe程序
安装pyinstallerpip3 install pyinstaller -i http://mirrors.aliyun.com/pypi/simple --trusted-host mirrors.aliyun.com打包exe,注意-p对应包路径E:\PythonStart\DataProcess> pyinstaller -F -p E:\PythonStart\DataProcess\venv\Lib\site-packages main.py打包成功...原创 2021-04-17 12:18:09 · 7682 阅读 · 0 评论 -
Pycharm安装gdal库
1gdal下载地址https://www.lfd.uci.edu/~gohlke/pythonlibs/#gdal2项目venv\Scripts文件夹下 Shift+鼠标右键在此处打开命令窗口输入pip installGDAL-2.4.1-cp37-cp37m-win_amd64.whl报错:请升级您的python,因为已不再维护pthon2.7......下载个ad3-2.2.1-cp27-cp27m-win_amd64.whl继续显示安装成功安装目录中存在osge...原创 2021-04-15 16:23:17 · 13584 阅读 · 6 评论