TransWikia.com

ogr2ogr doesn't find PostgreSQL driver

Geographic Information Systems Asked by slambeth on April 17, 2021

I’ve seen this question several times, but I’m not 100% sure what needs to happen for my situation. Quite often the answer is to install OpenGEO4W & GDAL, but it appears I already have GDAL.

I just did a fresh install of the all in one PostgreSQL and PostGIS windows installer. PostGIS seems to be working quite fine. I’m attempting to use the ogr2ogr utility to ultimately migrate geo tables into a SpatiaLite database. I only found the OGR exectubles in one spot and that is in the pgsql bin folder.

ogr2ogr --version results in this:

GDAL 3.2.0, released 2020/10/26

To simplify this I can generate the error I’m getting by running ogrinfo and attempt to connect to my local pgsql host, like so:

databasePostgreSQL13bin>ogrinfo PG:"host=127.0.0.1 port=5432 user='postgres' password='blablabla' dbname='postgis_30_sample'"

And the instant outcome is this:

FAILURE:
Unable to open datasource `PG:host=127.0.0.1 port=5432 user='postgres' password='blablabla' dbname='postgis_30_sample'' with the following drivers.
  -> ESRIC
  -> PCIDSK
  -> PDS4
  -> VICAR
  -> JP2OpenJPEG
  -> PDF
  -> MBTiles
  -> EEDA
  -> OGCAPI
  -> ESRI Shapefile
  -> MapInfo File
  -> UK .NTF
  -> LVBAG
  -> OGR_SDTS
  -> S57
  -> DGN
  -> OGR_VRT
  -> REC
  -> Memory
  -> BNA
  -> CSV
  -> GML
  -> GPX
  -> KML
  -> GeoJSON
  -> GeoJSONSeq
  -> ESRIJSON
  -> TopoJSON
  -> OGR_GMT
  -> GPKG
  -> SQLite
  -> ODBC
  -> WAsP
  -> PGeo
  -> MSSQLSpatial
  -> OpenFileGDB
  -> XPlane
  -> DXF
  -> CAD
  -> FlatGeobuf
  -> Geoconcept
  -> GeoRSS
  -> GPSTrackMaker
  -> VFK
  -> PGDUMP
  -> OSM
  -> GPSBabel
  -> SUA
  -> OpenAir
  -> OGR_PDS
  -> WFS
  -> OAPIF
  -> HTF
  -> AeronavFAA
  -> Geomedia
  -> EDIGEO
  -> SVG
  -> CouchDB
  -> Cloudant
  -> Idrisi
  -> ARCGEN
  -> SEGUKOOA
  -> SEGY
  -> XLS
  -> ODS
  -> XLSX
  -> Elasticsearch
  -> Walk
  -> Carto
  -> AmigoCloud
  -> SXF
  -> Selafin
  -> JML
  -> PLSCENES
  -> CSW
  -> VDV
  -> MVT
  -> NGW
  -> MapML
  -> TIGER
  -> AVCBin
  -> AVCE00
  -> HTTP

So, Is OpenGEO4W needed? And what install? It seems like the standard install is a large suite of tools? It is confusing to me that the instance packaged with the PgSQL install doesn’t have the driver necessary to connect to PgSQL. Is there a way to simply add the PgSQL driver for ogr?

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP