[postgis-tickets] [PostGIS] #3738: raster: Using -s and -R together in raster2pgsql transforms raster data instead of setting srid
PostGIS
trac at osgeo.org
Sun Apr 23 13:09:12 PDT 2017
#3738: raster: Using -s and -R together in raster2pgsql transforms raster data
instead of setting srid
---------------------+---------------------------
Reporter: robe | Owner: robe
Type: defect | Status: new
Priority: medium | Milestone: PostGIS 2.4.0
Component: raster | Version: 2.3.x
Resolution: | Keywords:
---------------------+---------------------------
Comment (by robe):
Okay this is clearly a bug and I think affects more than outdb. On some
tests I did, it seems if you don't use -Y and you use -s, it attempts to
do a ST_Transform.
If you use a -s without a -Y and happen to specify an srid that is
different from the one it detected from the meta data of the raster, then
it attempts to transform from the inferred srid to the new one.
So work around for out-of-db to get it to do the right thing is this:
{{{
raster2pgsql -C -t 500x500 -R -Y -s 26918 -F -I C:/gisdata/*.jp2
nj_aerials
}}}
--
I had an aerial with no metadata for the srid (would normally come in as
unknown), as long as I have a -Y in there it just does a setsrid. If I
leave out the Y, I get an error on insert.
If I do in-db then the from_srid:to_srid seems broken. It's like it's
traying to use the unknown srid as the from instead of what I specified.
anyway I have a patch for this. I plan to backport the part about -s srid
doing a transform instead of set.
I think there are some loose ends with the ST_Transform logic, and since
the transform feature was never announced, I may just keep that fix for
2.4 and just flag it as a new feature and keep the 2.3 transform logic
broken.
--
Ticket URL: <https://trac.osgeo.org/postgis/ticket/3738#comment:5>
PostGIS <http://trac.osgeo.org/postgis/>
The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project.
More information about the postgis-tickets
mailing list