zoukankan      html  css  js  c++  java
  • PostGIS解析Geometry几何对象

    一、Geometry转WKT

    select st_astext(geom) where tableName;

    二、PostGIS常用函数

    wkt转geometry st_geomfromtext(wkt,wkid)

    geometry转wkt st_astext(geom)

    获取点对象x、y坐标值 st_x(geom)、st_y(geom)

    获取线/面对象四至 st_xmin(geom)、st_ymin(geom)、st_xmax(geom)、st_ymax(geom)

    计算两点之间距离 st_distance(geom,geom) / st_distance(wkt,wkt)

    计算线的长度 st_length(geom) / st_length(wkt)

    计算面积 st_area(geom) / st_area(wkt)

    缓冲区计算 st_buffer(geom,distance) / st_buffer(wkt,distance)

    WKT几种对象格式

    POINT(0 0) ——点
    LINESTRING(0 0,1 1,1 2) ——线
    POLYGON((0 0,4 0,4 4,0 4,0 0),(1 1, 2 1, 2 2, 1 2,1 1)) ——面
    MULTIPOINT(0 0,1 2) ——多点
    MULTILINESTRING((0 0,1 1,1 2),(2 3,3 2,5 4)) ——多线
    MULTIPOLYGON(((0 0,4 0,4 4,0 4,0 0),(1 1,2 1,2 2,1 2,1 1)), ((-1 -1,-1 -2,-2 -2,-2 -1,-1 -1))) ——多面
    GEOMETRYCOLLECTION(POINT(2 3),LINESTRING((2 3,3 4))) ——几何集合

  • 相关阅读:
    SQL查看数据库中每张表的数据量和总数据量
    Asp.Net Mvc Area二级域名
    Asp.Net Mvc 整站Https
    Task 开始 停止
    最全省份城市生成代码
    代理
    反射和工厂模式
    枚举
    IO
    集合类(二)
  • 原文地址:https://www.cnblogs.com/bretgui/p/10197104.html
Copyright © 2011-2022 走看看