Opened 8 years ago

Closed 7 years ago

#739 closed enhancement (fixed)

[raster] UpdateRasterSRID

Reported by: etiennebr Owned by: Bborie Park
Priority: medium Milestone: PostGIS 2.1.0
Component: raster Version: trunk
Keywords: history Cc:

Description

Maybe it would be more elegant to have a UpdateRasterSRID or a ST_SetSRID(raster) than use the following

alter table <raster> drop constraint enforce_srid_rast; update <raster> set rast = st_setsrid(rast, <srid>); alter table <raster> add constraint enforce_srid_rast CHECK (st_srid(rast) = <srid>);

Change History (9)

comment:1 Changed 8 years ago by robe

Component: postgispostgis raster
Milestone: PostGIS 1.5.3PostGIS 2.0.0
Owner: changed from pramsey to pracine
Summary: UpdateRasterSRID[raster] UpdateRasterSRID
Version: 1.5.Xtrunk

comment:2 Changed 8 years ago by pracine

Milestone: PostGIS 2.0.0PostGIS Raster Future

comment:3 Changed 7 years ago by pracine

Milestone: PostGIS Raster FuturePostGIS Future

comment:4 Changed 7 years ago by Bborie Park

This seems inappropriate. ALTER and DROP would require DDL privileges. ST_SetSRID(raster) already exists.

comment:5 Changed 7 years ago by pracine

Isn't calling AddRasterConstraints?() also require DDL privileges? Most management function do so no? UpdateRasterSRID would just be one management function among others.

Otherwise, it should not be specific to raster but also take the parameters of a geometry table.

boolean UpdateSRID(name schema, name table, name rastorgeometrycolumn)

comment:6 Changed 7 years ago by robe

This seems reasonable to me. Much shorter than remembering the ALTER TABLE .. and ..

comment:7 Changed 7 years ago by robe

geometry already has such a function:

http://www.postgis.org/documentation/manual-svn/UpdateGeometrySRID.html

I think it's best not to try to create a generic one UpdateSRID since for geometry the default is typmod and trying to make it an IF geometry then else use constraints will make it complicated.

comment:8 Changed 7 years ago by Bborie Park

Owner: changed from pracine to Bborie Park
Status: newassigned

Thanks robe. That's what I was wondering.

comment:9 Changed 7 years ago by Bborie Park

Keywords: history added
Milestone: PostGIS FuturePostGIS 2.1.0
Resolution: fixed
Status: assignedclosed

Added in r10581

Note: See TracTickets for help on using tickets.