Thank you Rich,

I understand what you say but this leads to another question : 

Actually everything started when I first imported a basic table (imported it 
with SPIT in QGis) and all of the other table in my databases were derived from 
this first one by SQL scripts.  What I'v now noticed is that the first table 
had some constraints among which this one : CONSTRAINT "enforce_srid_the_geom" 
CHECK ((srid(the_geom) = -1))
The other tables don't have any constraint and when I try to update their 
geometry srid with updategeometrysrid I get an error related to this lack, 
while when doing this for my first table I obtain the new constrain value : 
CONSTRAINT "enforce_srid_the_geom" CHECK ((srid(the_geom) = 4326)).  

So does this mean that each time I create a new table from the first one (like 
with a simple "SELECT ... FROM first_table WHERE ....") I must execute an ALTER 
TABLE statement to add this constraint or is there another (easier) way to do 
this ?


Thanks again.

Didier


Le 2 janv. 2011 à 03:54, Richard Greenwood a écrit :

> On Sat, Jan 1, 2011 at 11:49 AM, didier peeters <dpeet...@ulb.ac.be> wrote:
>> Hi everybody,
>> 
>> I use QGis to display postgis data and in the geometry column I have srid = 
>> '-1' (no value).  Everything works fine, I only have to specify the srid in 
>> the QGis project but when I set the right srid directly into the geometry 
>> column table (srid = 4326, for WGS 84) I get the following error when trying 
>> to load the layer in QGis.
> 
> The -1 in the geometry_columns table probably means that a SRID was
> not specified when the data was imported. The updategeometrysrid()
> function can be used to assign a SRID to the geometry objects in a
> table. This does not transform the data to a new coordinate system, it
> simply assigns a new SRID, so it's up to you to choose the correct
> SRID:
> 
>   select updategeometrysrid('schema_name_optional', 'table_name','
> geometry_column_name', 4326);
> 
> After assigning the new (hopefully correct) SRID to all of geometry
> objects in the table, use the populate_geometry_columns() to update
> the geometry_columns table. This function examines all tables and view
> in the database and inserts/deletes/updates rows as appropriate.
> 
>   select populate_geometry_columns();
> 
> Rich
> 
> -- 
> Richard Greenwood
> richard.greenw...@gmail.com
> www.greenwoodmap.com
> _______________________________________________
> postgis-users mailing list
> postgis-users@postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-users

_______________________________________________
postgis-users mailing list
postgis-users@postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users

Reply via email to