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

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.

主站蜘蛛池模板: 和平县| 佛冈县| 双柏县| 临海市| 怀宁县| 两当县| 海丰县| 屯留县| 郴州市| 嵩明县| 黔西| 岢岚县| 静安区| 光山县| 沙坪坝区| 广西| 柳林县| 运城市| 东辽县| 正蓝旗| 景泰县| 滨海县| 温州市| 嘉荫县| 芜湖县| 浮山县| 三台县| 启东市| 延寿县| 乌拉特中旗| 新建县| 芷江| 新乡市| 信阳市| 正定县| 谷城县| 墨玉县| 温州市| 昂仁县| 徐水县| 策勒县|