pgsql2shp PostgreSQL中的错误

时间:2018-07-17 15:24:02

标签: database postgresql postgis postgresql-9.5

我想使用以下命令行从postgresql数据库中转储shapefile:

    CLLocationCoordinate2D vancouver = CLLocationCoordinate2DMake(23.63936, 68.14712);
    CLLocationCoordinate2D calgary = CLLocationCoordinate2DMake(28.20453, 97.34466);
    GMSCoordinateBounds *bounds =
    [[GMSCoordinateBounds alloc] initWithCoordinate:vancouver coordinate:calgary];
    [mapView setCameraTargetBounds:bounds];
    GMSCameraPosition *camera = [GMSCameraPosition cameraWithLatitude:currentLocation.coordinate.latitude
                                                            longitude:currentLocation.coordinate.longitude
                                                                 zoom:18];

    mapView.camera = camera;

但它继续显示错误:

pgsql2shp -f output.shp -h localhost -u postgres -P admin parcel "SELECT * FROM parcel.export_output WHERE ParcelNoEng=116"

我应该怎么做才能使其正常工作? 我已将Postgresql / version / bin添加到我的环境变量中。

1 个答案:

答案 0 :(得分:1)

您缺少PostGIS extension。使用您选择的客户端在PostgreSQL中执行以下命令,例如psql,然后重试:

CREATE EXTENSION postgis;