0
点赞
收藏
分享

微信扫一扫

PostGIS实战

看山远兮 2022-03-11 阅读 50
数据库dba

PostGIS实战书分三个部分,13个章节,总页数491页,逻辑清晰,实战性强。

第一部分结合PostGIS软件,介绍空间数据库的基本概念,涵盖空间数据库,PostGIS与Postgres之间的关系、空间数据库类型,空间数据组织、图形函数,图形关系、空间坐标参考、矢量数据如何导入和导出等;

第二部分主要介绍矢量数据库使用,介绍如何让PostGIS工作,包含空间邻近分析,属性数据创建,图形数据创建,坐标变换,空间查询数据创建和空间索引、SQL、图形等PostGIS数据库性能优化。

第三部分介绍PostGIS与其他GIS软件的协同、webGIS中如何使用PostGIS以及PostGIS栅格数据库的使用,包含PostGIS与MapServer、GeoServer、OpenLayers、Cadcorp SIS、OpenJUMP、QGIS、uDig、gvSIG等软件的使用,为PostGIS提供栅格数据库创建、栅格表和函数、栅格数据导入和导出、栅格数据与矢量数据综合分析等。

附件ABC列出了一大堆开源GIS的软件、资源与技术方法,PostGIS与Postgres安装、编译与升级、SQL primer、PostgreSQL features和POSTGIS相关的空间分析函数。(本人倒是更喜欢这个)

 

先写到这,后续慢慢更新。

启发式语录

空间数据库作用:空间数据库可以用于空间数据存储和分析。

A spatial database gives you both a storage tool and an analysis tool.

空间数据建模:完整的2D映射可以用三个基本几何图形来完成:点、线串和多边形。我们可以用这些基本构件来模拟自然地理实体,点、线、弦和多边形是现实的简化模型。因此,它们永远无法完美地模仿真实的东西。

The entirety of 2D mapping can be accomplished with three basic geometries: points,
linestrings, and polygons. We can model physical geographical entities with these
basic building blocks.Points, linestrings, and polygons are simplified models of reality. As such, they’ll never perfectly mimic the real thing.

空间查询和空间函数作用:空间查询是一种数据库查询,它使用图形函数来回答关于空间和空间中对象的问题。除了能够回答关于空间使用的问题外,空间函数还允许你在空间中创建和修改对象。空间分析的这一部分通常被称为几何或空间处理。

A spatial query is a database query that uses geometric functions to answer questions about space and objects in space.In addition to being able to answer questions about the use of space, spatial functions allow you to create and modify objects in space. This portion of spatial analysis is often referred to as geometric or spatial processing. 

 对象关系数据库作用:对象关系数据库可以在关系表列中存储比基本日期、数字和文本更复杂的对象类型,并允许用户定义新的自定义数据类型、新函数和操作符来操作这些新的自定义类型。

An object-relational database is one that can store more complex types of objects in
its relational table columns than the basic date, number, and text and that allows the
user to define new custom data types, new functions, and operators that manipulate
these new custom types.

PostgreSQL是Sybase和Microsoft SQL Server数据库的兄弟,因为创建Sybase的人来自加州大学伯克利分校,并与Michael Stonebraker一起在Ingres和/或PostgreSQL项目上工作。许多人认为Michael Stonebraker是Ingres和PostgreSQL之父,也是对象关系数据库管理系统的创始人之一。Sybase SQL Server的源代码后来被授权给微软来生产Microsoft SQL Server。

PostgreSQL is a cousin of the databases Sybase and Microsoft SQL Server because the people who started Sybase came from UC Berkeley and worked on the Ingres and/ or PostgreSQL projects with Michael Stonebraker. Michael Stonebraker is considered by many to be the father of Ingres and PostgreSQL and one of the founding fathers of object-relational database management systems.The source code of Sybase SQL Server was later licensed to Microsoft to produce Microsoft SQL Server. 

PostgreSQL支持大多数ANSI SQL 92-2003+和部分ANSI SQL 2006。PostGIS支持OGC标准SQL/MM Spatial (ISO JTC1, WG4, 13249-3)。

PostgreSQL supports most of ANSI SQL 92-2003+ and some of ANSI SQL 2006. PostGIS supports OGC standards SQL/MM Spatial (ISO JTC1, WG4, 13249-3). 

 

语句

SELECT postgis_full_version();

SELECT version();

SELECT ST_Point(1, 2) AS MyFirstPoint;

SELECT ST_SetSRID(ST_Point(-77.036548, 38.895108),4326);

SELECT ST_GeomFromText('POINT(-77.036548 38.895108)', 4326);

SELECT ST_AsEWKT('0101000020E6100000FD2E6CCD564253C0A93121E692724340');

SELECT ST_GeomFromText('LINESTRING(-14 21,0 0,35 26)') AS MyCheckMark;

SELECT ST_GeomFromText('LINESTRING(52 218, 139 82, 262 207, 245 261, 207 267,
153 207, 125 235, 90 270, 55 244, 51 219, 52 218)') AS HeartLine;

SELECT ST_GeomFromText('POLYGON((0 1,1 -1,-1 -1,0 1))') As MyTriangle;

SELECT ST_GeomFromText('POLYGON((52 218, 139 82, 262 207, 245 261,
207 267, 153 207, 125 235, 90 270,
55 244, 51 219, 52 218))') As HeartPolygon;
 

举报

相关推荐

0 条评论