gdal_translate does not have a PostGIS raster writer (or at least not last time I checked). So you can’t use it to load rasters into PostGIS, but can use it to output postgis raster to other formats. Need to use raster2pgsql for PostGIS raster loading.
As far as ogr2ogr vs. shp2gpsql there probably isn’t much of a difference between shp2pgsql vs. ogr2ogr. Both use some variant of shapelib library. Though I think ogr2ogr may make a direct connection where as shp2pgsql just generates a script. That said you could achieve the same in ogr2ogr. So that’s more of a limitation of shp2pgsql than a benefit. From: postgis-users [mailto:postgis-users-boun...@lists.osgeo.org] On Behalf Of Micha Silver Sent: Friday, February 14, 2020 6:03 AM To: PostGIS Users Discussion <postgis-users@lists.osgeo.org>; Jachym Cepicky <jachym.cepi...@gmail.com> Subject: Re: [postgis-users] gdal or shp2pgsql On 14/02/2020 12:50, Jachym Cepicky wrote: Hi all, I would like to ask, whether you are aware of any big performance differences or any other serious reasons, why could shp2pgsql and raster2pgsql be preferred over ogr2ogr and gdal_translate ? Encoding of attribute tables in shapefiles is often a problem, and shp2pgsql has the -W option to help to get it right. I don't know how I would duplicate that in ogr2ogr. Maybe with some -lco incantation? Thanks, Micha >From the users perspective, I can use both tools on similar manner and have no problem with "complex" gdal data model and parameters options and I would probably prefer the GDAL tools, since it allows me to translate between various formats without specifically care, what they are, while *2pgsql is always Postgres specific Maybe one missing feature of the PostGIS native tools: is there elegant way (besides of subprocess module), how to use them in Python(3) environment? Thank you for clarification Jachym -- Micha Silver Ben Gurion Univ. Sde Boker, Remote Sensing Lab cell: +972-523-665918 https://orcid.org/0000-0002-1128-1325
_______________________________________________ postgis-users mailing list postgis-users@lists.osgeo.org https://lists.osgeo.org/mailman/listinfo/postgis-users