Opened 14 years ago

Closed 12 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: master
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 by robe, 14 years ago

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 by pracine, 14 years ago

Milestone: PostGIS 2.0.0PostGIS Raster Future

comment:3 by pracine, 13 years ago

Milestone: PostGIS Raster FuturePostGIS Future

comment:4 by Bborie Park, 12 years ago

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

comment:5 by pracine, 12 years ago

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 by robe, 12 years ago

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

comment:7 by robe, 12 years ago

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 by Bborie Park, 12 years ago

Owner: changed from pracine to Bborie Park
Status: newassigned

Thanks robe. That's what I was wondering.

comment:9 by Bborie Park, 12 years ago

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

Added in r10581

Note: See TracTickets for help on using tickets.