官术网_书友最值得收藏!

Importing shape files using shp2pgsql

ESRI shapefile (SHP) is still the most common exchange format for sharing GIS data. The format itself is made of a few files such as SHP, SHX, DBF, andPRJ, where the first three are the required files and the file with projection information is not obligatory.

The standard PostGIS tool for loading shapefiles is shp2pgsql - you will find it in the bin folder of your postgres installation. shp2pgsql is a command-line utility that can either extract the shapefile data into SQL or pipe the output directly into psql (we'll see both approaches). shp2pgsql also has a GUI version that can be accessed directly in PgAdmin.

In this example, we'll use some NaturalEarth shapefiles we downloaded earlier. We will import the coastlines shapefile using the CMD version of shp2pgsql and then we'll add land masses using the GUI version.

主站蜘蛛池模板: 嘉鱼县| 慈溪市| 余干县| 霍山县| 宽城| 兴文县| 会泽县| 得荣县| 石林| 金坛市| 商南县| 乐平市| 曲麻莱县| 项城市| 闸北区| 怀宁县| 岱山县| 林州市| 应城市| 长武县| 徐水县| 东山县| 潞西市| 宁南县| 裕民县| 张家港市| 花莲县| 德格县| 永春县| 定结县| 洮南市| 习水县| 当涂县| 平安县| 聂拉木县| 南丰县| 新龙县| 巫溪县| 卢龙县| 邳州市| 兴城市|