4. 插入数据
INSERT INTO gtest (ID, NAME, GEOM) VALUES (1,'First Geometry',ST
_GeomFromText('LINESTRING(2 3,4 5,6 5,7 8)', -1));
5.查看表――类似 show talbes(MY SQL)
6. 导入数据
Once you have created a spatial table, you are ready to upload GIS data to the database.
Currently, there are two ways to get data into a PostGIS/PostgreSQL database: using formatted
SQL statements or using the Shape file loader/dumper。
首先是创建表极其几何关系:
CREATE TABLE roads (road_id int4, road_name varchar(20) );
SELECT AddGeometryColumn(’’, ’ roads’,’ roads_geom’,-1,’LINESTRING’,2);
然后用导入脚本文件:
psql -U postgres -W -f "E:\road.sql" my_spatial_db
评论0
最新资源