I may very well be doing something wrong here, but:
If I import some shapefile to a PostGIS database using shp2pgsql, I have to first figure out the SRID/EPSG of that shapefile. I think this is, at minimum, a two step process. First I query the shapefile like this:
>ogrinfo -al -so someshapefile.shp
which returns the well-known text (wkt) projection information, but is a bit verbose and somewhat opaque [to me]. Something like:
GEOGCS["NAD83",
DATUM["North_American_Datum_1983",
SPHEROID["GRS 1980",6378137,298.257222101,
AUTHORITY["EPSG","7019"]],
AUTHORITY["EPSG","6269"]],
PRIMEM["Greenwich",0,
AUTHORITY["EPSG","8901"]],
UNIT["degree",0.01745329251994328,
AUTHORITY["EPSG","9122"]],
AUTHORITY["EPSG","4269"]]
I then typically run the wkt info through a conversion tool like Prj2EPSG to find the EPSG/SRID.
At this point, I can import the shapefile using:
>shp2pgsql -I -s 4269 someshapefile.shp <schema>.<table> | psql -U <user> -d <dbname> -h <hostaddress> -p 5432
Note, I specify the SRID with the -s
flag.
If, I run shp2pgsql without specifying the SRID, no projection is set and I think the geom column has to manually be updated to include a projection.
Alternatively, I can skip the lookup, and just use ogr2ogr:
>ogr2ogr -f "PostgreSQL" "PG:host=<hostaddress> user=<user> dbname=<dbname> password=<password>" "C:/shapefile.shp" -nln <schema>.<table>
which apparently sets the projection fine, presumably extracting it automatically from the source shapefile/prj.
Question
So what's the disadvantage to using ogr2ogr? Is there in fact a flag so shp2pgsql automatically extracts and set the right projection also? If not, why not?
Addendum
There's an interesting, perhaps slightly dated, comparative analysis of using ogr2ogr vs shp2pgsql available on naturalgis.pt. It demonstrates for their particular sample data, that ogr2ogr performs significantly better on small datasets, but that shp2pgsql performs slightly better on larger datasets.
I don't feel this provides a definitive answer. The codebases may have evolved, improving each one's performance. They've only tested a very small set of sample data. The representative "large" dataset isn't actually that large. Also, it is mainly discussing issues of performance, which certainly affects usability, but the original question is more interested in usability related user input requirements.