irstv/orbisgis — pull request #94 by gourlaysama (2012-08-13 09:28:04+00:00)
Title: Add some more CRS-related functions

This PR:

* re-enables the old syntax for `ST_Transform` (parallel to the new one):

```sql
SELECT ST_Transform(the_geom, 'EPSG:4326', 'EPSG:27582') FROM toto;
-- and the new one is still there:
SELECT ST_Transform(the_geom, 'EPSG:27582') FROM toto;
```
* adds a setter function `ST_SetCRS` and getter function `ST_CRS` (these names come from PostGIS):

```sql
-- gets the name of the CRS, or null if none
SELECT ST_CRS(the_geom) FROM toto;
-- sets the CRS before inserting somewhere
-- this does not transform anything, just set
INSERT INTO tata SELECT ST_SetCRS(the_geom, 'EPSG:4326') FROM toto;
```

@ebocher: this is for you :-)

Note that this has nothing to do with the CRS constraint that there can be on a column. These constraints only check that whatever is inserted into the table / extracted from the table has the proper CRS.

Another PR should come with a better API to deal specifically with CRS constraints.