mysql gis postgre_PostgreSQL MySQL 兼容性之 - Gis类型-阿里云开发者社区

PostGIS的GIS功能相比MySQL强大太多,本文仅仅列举了MySQL支持的部分。

欲了解PostGIS请参考:

http://postgis.net/docs/manual-2.2/reference.html

PostGIS有几百个操作函数, 对GIS支持强大。

POINT

MySQL

POINT

PointFromText('POINT(10 10)')

PointFromWKB(AsWKB(PointFromText('POINT(10 20)'))

PostgreSQL

# PostgreSQL

point

point( x , y )

# PostGIS

point

LINESTRING

MySQL

LINESTRING

CREATE TABLE gis_line (g LINESTRING);

SHOW FIELDS FROM gis_line;

INSERT INTO gis_line VALUES

(LineFromText('LINESTRING(0 0,0 10,10 0)')),

(LineStringFromText('LINESTRING(10 10,20 10,20 20,10 20,10 10)')),

(LineStringFromWKB(AsWKB(LineString(Point(10, 10), Point(40, 10)))));

GLENGTH

Length of a LineString value

ST_ENDPOINT

Returns the endpoint of a LineString

ST_NUMPOINTS

Returns the number of Point objects in a LineString

ST_POINTN

Returns the N-th Point in the LineString

ST_STARTPOINT

Returns the start point of a LineString

PostgreSQL

# PostGIS

LINESTRING

ST_Length — Returns the 2D length of the geometry if it is a LineString or MultiLineString. geometry are in units of spatial reference and geography are in meters (default spheroid)

ST_Length2D — Returns the 2-dimensional length of the geometry if it is a linestring or multi-linestring. This is an alias for ST_Length

ST_3DLength — Returns the 3-dimensional or 2-dimensional length of the geometry if it is a linestring or multi-linestring.

ST_LengthSpheroid — Calculates the 2D or 3D length of a linestring/multilinestring on an el

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值