2019年6月29日星期六

qgis计算多边形面积不正确

更新:
找到原因了,qgis的字段计算器中,有两个计算面积的函数
$area 和  area ,
第二个函数计算的面积,与postgis、arcmap计算的是一样的。
更深层次的原因,需要进一步研究。



以一个三角形的geojson文件为例,
{
"type": "FeatureCollection",
"name": "sjx",
"crs": { "type": "name", "properties": { "name": "urn:ogc:def:crs:EPSG::4548" } },
"features": [
{ "type": "Feature", "properties": { "Maximum wa": 0.0, "Time at ma": 0.0, "Maximum cu": 0.0, "Time at ma_1": 0.0, "Duration a": 0.0, "Area": 16370.056, "area_qgis": 16370.06924014238, "area_pgl": null }, "geometry": { "type": "MultiPolygon", "coordinates": [ [ [
[ 414847.64296299999114, 4390359.33534799981862 ],
[ 414743.891589, 4390580.790721 ],
[ 414922.68434799998067, 4390514.77821699995548 ],
[ 414847.64296299999114, 4390359.33534799981862 ] ] ] ] } }
]
}

qgis计算的面积为 16370,
但根据三角形面积计算公式,还有postgis、arcmap计算的面积均为16372 。
为什么呢?
记得以前遇到过qgis计算多边形最小包围矩形也不正确。

2019年6月28日星期五

postgresql tutorial

http://www.postgresqltutorial.com/

https://www.w3schools.com/sql/sql_count_avg_sum.asp

在Dos窗口中,添加postgresql可执行文件的目录

set PATH=C:\Program Files\PostgreSQL\11\bin;%PATH%
ps:很奇怪,只有这样设置,psql才能正常执行,为什么呢?
    为什么加上双引号就出错呢?目录里的空格不需要特殊处理吗?

postgis

shp2pgsql-uses-deprecated-addgeometrycolumn-function

PostGIS 2.5.3dev Manual

shp2pgsql向postgresql导入shape数据

shp_postgis

postgis-intro/loading_data.html

AddGeometryColumn

pgadmin4-geometry-viewer

PostGIS-geometry-viewer

shp2pgsql不支持shape文件的prj文件:
shp2pgsql-and-prj-files
using-shp2pgsql-instead-of-ogr2ogr-to-import-shapefile-to-postgis


2019年6月22日星期六

CGAL

cgal.rb

CGAL DEMO 演示

configuring-cgal-with-qt5-and-qglviewer-on-mac

手动更新Homebrew formula

brew install http://liris.cnrs.fr/david.coeurjolly/misc/libqglviewer.rb

brew install qt

 ~ $ brew install qt5
Updating Homebrew...
==> Downloading https://homebrew.bintray.com/bottles/qt-5.12.3.mojave.bottle.tar.gz
==> Downloading from https://akamai.bintray.com/b6/b669ba7803986326f32e9fe5d2b7229e6ecd806517e8bf750ea4ec59fa8da45f?__gda__=exp=1561215887~hmac=0a33b435c9f633b3fd05f0d3b935cbc30ffa39343642ad5e6f6e5fcb774f
######################################################################## 100.0%
==> Pouring qt-5.12.3.mojave.bottle.tar.gz
==> Caveats
We agreed to the Qt open source license for you.
If this is unacceptable you should uninstall.

qt is keg-only, which means it was not symlinked into /usr/local,
because Qt 5 has CMake issues when linked.

If you need to have qt first in your PATH run:
  echo 'export PATH="/usr/local/opt/qt/bin:$PATH"' >> ~/.bash_profile

For compilers to find qt you may need to set:
  export LDFLAGS="-L/usr/local/opt/qt/lib"
  export CPPFLAGS="-I/usr/local/opt/qt/include"


==> qt
We agreed to the Qt open source license for you.
If this is unacceptable you should uninstall.

qt is keg-only, which means it was not symlinked into /usr/local,
because Qt 5 has CMake issues when linked.

If you need to have qt first in your PATH run:
  echo 'export PATH="/usr/local/opt/qt/bin:$PATH"' >> /Users/lyq/.bash_profile

For compilers to find qt you may need to set:
  export LDFLAGS="-L/usr/local/opt/qt/lib"
  export CPPFLAGS="-I/usr/local/opt/qt/include"

For pkg-config to find qt you may need to set:
  export PKG_CONFIG_PATH="/usr/local/opt/qt/lib/pkgconfig"

==> ncurses
ncurses is keg-only, which means it was not symlinked into /usr/local,
because macOS already provides this software and installing another version in
parallel can cause all kinds of trouble.

If you need to have ncurses first in your PATH run:
  echo 'export PATH="/usr/local/opt/ncurses/bin:$PATH"' >> /Users/lyq/.bash_profile

For compilers to find ncurses you may need to set:
  export LDFLAGS="-L/usr/local/opt/ncurses/lib"
  export CPPFLAGS="-I/usr/local/opt/ncurses/include"

For pkg-config to find ncurses you may need to set:
  export PKG_CONFIG_PATH="/usr/local/opt/ncurses/lib/pkgconfig"

==> tmux
Example configuration has been installed to:
  /usr/local/opt/tmux/share/tmux

Bash completion has been installed to:
  /usr/local/etc/bash_completion.d

docker GoogleEarth

cannot-connect-to-the-docker-daemon-on-macos

Python Installation - Datalab on local machine


lyq ~ $ export CONTAINER_IMAGE_NAME=gcr.io/earthengine-project/datalab-ee:latest
lyq ~ $ export WORKSPACE=${HOME}/workspace/datalab-ee
lyq ~ $ export GCP_PROJECT_ID=akaakaaka
lyq ~ $ mkdir -p $WORKSPACE
lyq ~ $ cd $WORKSPACE
lyq datalab-ee $ docker run -it -p "127.0.0.1:8081:8080" -v "$WORKSPACE:/content" -e "PROJECT_ID=$GCP_PROJECT_ID" $CONTAINER_IMAGE_NAME

卫星图片下载

如何批量下载卫星地图

https://github.com/modyuan/getmap


2019年6月20日星期四

2019年6月19日星期三

OSX Finder 显示隐藏文件

Mac系统如何显示隐藏文件?

Command+Shift+. 可以显示隐藏文件、文件夹,再按一次,恢复隐藏;
finder下使用Command+Shift+G 可以前往任何文件夹,包括隐藏文件夹。

2019年6月18日星期二

OSX常用软件


  1. MacVim
  2. homebrew
  3. iterm2
  4. miniconda
  5. fzf
  6. shadowsocks
  7. chrome
  8. vscode
  9. sublime text
  10. screenshotmenu
  11. magnet
  12. ezip
  13. FinderGo
  14. mpv
  15. qgis
  16. IINA
  17. gimp
  18. GoogleEarth

OSX 中,启动终端或者iterm2时,bash使用不同的启动文件

why-doesnt-bashrc-run-automatically

bashrc-not-sourced-in-iterm-mac-os-x

2019年6月17日星期一

多边形 的 中轴线

How do I calculate the medial axis for a 2D vector shape?



三角网

Iterating Over a Triangulation in Java

https://github.com/bennycheung/PyDelaunay

Triangulated irregular network

从Delaunay三角化到网格质量

http://www.gradientspace.com/tutorials

https://github.com/gradientspace/geometry3Sharp

https://www.grasshopper3d.com/forum/topics/tri-to-quad-mesh

三角网格上的寻路算法

https://www.cs.cmu.edu/~quake/triangle.html

Triangle 中文编译说明

triangle程序python使用说明

三角剖分的各种语言实现

d3-delaunay

D3三角剖分动态演示

https://www.cs.cmu.edu/~quake-papers/

Figure 7.16: Line-Graded Layer Mesh

https://www.ics.uci.edu/~eppstein/280g/

http://www.openmesh.org/

The_Half-Edge_Data_Structure

advanced-methods-in-computer-graphics






国外学术文章下载

https://www.researchgate.net/publication/220387872_Area_Collapse_and_Road_Centerlines_based_on_Straight_Skeletons

https://www.semanticscholar.org/topic/Straight-skeleton/124603