首页 > 数据库技术 > 详细

与postgis相关的一些常用的sql

时间:2017-05-12 14:51:51      阅读:374      评论:0      收藏:0      [点我收藏+]
create table NODES (ID SERIAL not null,geometry geography(POINTZ, 4326) null);
create table EDGES (ID SERIAL not null,geometry geography(LINESTRINGZ, 4326) null);


insert into nodes(geometry) values(ST_GeographyFromText(‘SRID=4326; POINT(-110 30 40)‘));
insert into edges(geometry) values(ST_GeographyFromText(‘SRID=4326; LINESTRING(-110 30 40,11 22 33)‘));

alter table public.nodes alter column geometry set data type geography(PointZ,4326);

select ST_AsText(geometry) from nodes;
select ST_AsText(geometry) from edges;

  

与postgis相关的一些常用的sql

原文:http://www.cnblogs.com/lwmp/p/6845509.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!