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

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.

主站蜘蛛池模板: 元谋县| 江门市| 宝应县| 大理市| 大厂| 佳木斯市| 梨树县| 石景山区| 绥芬河市| 舞阳县| 炉霍县| 定西市| 合肥市| 铅山县| 义马市| 海晏县| 禹州市| 绿春县| 林州市| 台北市| 永定县| 申扎县| 大庆市| 济源市| 垣曲县| 铁力市| 沈丘县| 铜山县| 梅州市| 策勒县| 林口县| 临江市| 博爱县| 福鼎市| 修武县| 张家港市| 商丘市| 上高县| 弋阳县| 嫩江县| 三穗县|