[postgis-users] gdal or shp2pgsql

Regina Obe lr at pcorp.us
Fri Feb 14 11:12:41 PST 2020


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-bounces at lists.osgeo.org] On Behalf Of Micha Silver
Sent: Friday, February 14, 2020 6:03 AM
To: PostGIS Users Discussion <postgis-users at lists.osgeo.org>; Jachym Cepicky <jachym.cepicky at 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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20200214/fb9d01ef/attachment.html>


More information about the postgis-users mailing list