Convert Tables in Postgresql to Shapefile

user7590842

So far I have loaded all the parcel tables (with geometry information) in Alaska to PostgreSQL. The tables are originally stored in dump format. Now, I want to convert each table in Postgres to shapefile through cmd interface using ogr2ogr.

My code is something like below:

ogr2ogr -f "ESRI Shapefile" "G:\...\Projects\Dataset\Parcel\test.shp" PG:"dbname=parceldb host=localhost port=5432 user=postgres password=postgres" -sql "SELECT * FROM ak_fairbanks"

However, the system kept returning me this info: Unable to open datasource

PG:dbname='parceldb' host='localhost' port='5432' user='postgres' password='postgres'

With the following drivers.

Bharti Mohane

There is pgsql2shp option also available. For this you need to have this utility in your system.

The command that can be follow for this conversion is

pgsql2shp  -u <username> -h <hostname> -P <password> -p 5434 -u postgres -f <file path to save shape file> <table_name>

This command has other options also which can be seen on this link.

この記事はインターネットから収集されたものであり、転載の際にはソースを示してください。

侵害の場合は、連絡してください[email protected]

編集
0

コメントを追加

0

関連記事

分類Dev

Overlap (or convert) a raster in shapefile with R software

分類Dev

Postgresql: Function with temporary tables

分類Dev

Convert Minutes to Hours in PostgreSQL

分類Dev

Convert columns data into rows in PostgreSQL

分類Dev

Convert mysql binary to postgresql bytea

分類Dev

How to grant limited permissions to PostgreSQL tables?

分類Dev

How to convert a list of tables to a data frame in R

分類Dev

Convert PostgreSQL SQL dump to PostgreSQL custom-format dump

分類Dev

Manually convert PostgreSQL binary format of timestamp to integer

分類Dev

How to convert a Postgresql timestamptz to a Javascript Date?

分類Dev

Data schema to represent relationship of single column to multiple tables in PostgreSQL

分類Dev

R: Gradient plot on a shapefile

分類Dev

Vertical lines in a polygon shapefile

分類Dev

Convert user access query from postgreSQL to SQL Server

分類Dev

PostgreSQL-すべてのスキーマでALTERDEFAULT PRIVILEDGES .... SELECT ON TABLES ...

分類Dev

Using ggplot to plot shapefile and gganimate for animation

分類Dev

Plot shapefile city borders on top of cartopy map

分類Dev

Subsetting NYC shapefile to Manhattan using Geopandas

分類Dev

Java converter from kml/shapefile to Geojson

分類Dev

How to convert postgresql 9.4 jsonb to object without function/server side language

分類Dev

could not Convert legacy permission algorithm to 5 while migrating from liferay 5.2.3 to 6.0.6 tomcat with PostgreSQL

分類Dev

How to extract the data in a netcdf file based on a shapefile in R?

分類Dev

Display shapefile map on web browser using angular2

分類Dev

NetLogo GIS extension: How to create turtles according to location information in shapefile

分類Dev

Drop Pandas dataframe rows if geocoordinates outside country shapefile

分類Dev

Creating a whole new world with shapefile format of different layers in one file

分類Dev

PysalでShapefileを使用する方法

分類Dev

Reformatting tables

分類Dev

Multiple Tables

Related 関連記事

  1. 1

    Overlap (or convert) a raster in shapefile with R software

  2. 2

    Postgresql: Function with temporary tables

  3. 3

    Convert Minutes to Hours in PostgreSQL

  4. 4

    Convert columns data into rows in PostgreSQL

  5. 5

    Convert mysql binary to postgresql bytea

  6. 6

    How to grant limited permissions to PostgreSQL tables?

  7. 7

    How to convert a list of tables to a data frame in R

  8. 8

    Convert PostgreSQL SQL dump to PostgreSQL custom-format dump

  9. 9

    Manually convert PostgreSQL binary format of timestamp to integer

  10. 10

    How to convert a Postgresql timestamptz to a Javascript Date?

  11. 11

    Data schema to represent relationship of single column to multiple tables in PostgreSQL

  12. 12

    R: Gradient plot on a shapefile

  13. 13

    Vertical lines in a polygon shapefile

  14. 14

    Convert user access query from postgreSQL to SQL Server

  15. 15

    PostgreSQL-すべてのスキーマでALTERDEFAULT PRIVILEDGES .... SELECT ON TABLES ...

  16. 16

    Using ggplot to plot shapefile and gganimate for animation

  17. 17

    Plot shapefile city borders on top of cartopy map

  18. 18

    Subsetting NYC shapefile to Manhattan using Geopandas

  19. 19

    Java converter from kml/shapefile to Geojson

  20. 20

    How to convert postgresql 9.4 jsonb to object without function/server side language

  21. 21

    could not Convert legacy permission algorithm to 5 while migrating from liferay 5.2.3 to 6.0.6 tomcat with PostgreSQL

  22. 22

    How to extract the data in a netcdf file based on a shapefile in R?

  23. 23

    Display shapefile map on web browser using angular2

  24. 24

    NetLogo GIS extension: How to create turtles according to location information in shapefile

  25. 25

    Drop Pandas dataframe rows if geocoordinates outside country shapefile

  26. 26

    Creating a whole new world with shapefile format of different layers in one file

  27. 27

    PysalでShapefileを使用する方法

  28. 28

    Reformatting tables

  29. 29

    Multiple Tables

ホットタグ

アーカイブ