Hi Christian,
Thanks to your guide finally I could do what I wanted to.
1- The query

SELECT * FROM geometry_columns;

Returned no data showing my the_geom column was not registered in
geometry_columns as you suspected.

2- I created a new geometry column:

SELECT AddGeometryColumn( 'mypoints', 'the_geom_4326', 4326, 'POINT', 2);

that was Ok as I checked that it was registered in geometry_columns table

3-Load the data from the_geom column to the new one the_geom_4326

UPDATE mypoints SET the_geom_4326 = ST_SetSRID(the_geom,4326);

4-Check all the data entered in the_geom_4326 are with the right SRID:

select st_srid(the_geom) from mypoints;

which shown that everything is Ok.

5-Check that the points in the new column have the right data:

Select st_xmin(the_geom), st_ymin(the_geom) from mypoints


 6-Drop the_geom column and rename the_geom_4326 to the_geom
6-Calculate distances in meters. An example

SELECT ST_Distance(ST_Transform(the_geom,22171),
ST_Transform(ST_GeomFromText('POINT(-58.0 0.0)', 4326),22171)) from mypoints

which returns the right results.

Thanks again Christian and everybody in the mail list for helping people to
learn PostGIS.

Regards,

Mario



On Thu, Jan 21, 2010 at 6:49 PM, Chris Hermansen <
[email protected]> wrote:

> SELECT * FROM geometry_columns;
>
> if your table is in there, you will see a line that contains its name in
> f_table_name and its geometry column in f_geometry_column.  You don't need
> to guess.  Check its SRID there.
>
> You have some spatial queries that work ok with an SRID of -1.  Things like
> st_transform() don't work with an unknown SRID (which is what a -1 means).
>  AFAIK some of these operations need a row in geometry_columns.
>
>
> Oscar Zamudio wrote:
>
>> How can I test if it is not registered?. Nevertheless all the other
>> spatial queries are working well (ST_distanc for example) so I guess it is
>> registered. On the contrary ther will be no access to this kind of
>> operations.
>>
>> On Thu, Jan 21, 2010 at 5:24 PM, Chris Hermansen <
>> [email protected] <mailto:[email protected]>>
>> wrote:
>>
>>    Maybe your column is not registered in geometry_columns?
>>    Chris Hermansen        [email protected]
>>    <mailto:[email protected]>
>>
>>    tel+1.604.714.2878 · fax+1.604.733.0631 · mob+1.778.840.4625
>>    Timberline Natural Resource Group · www.timberline.ca
>>    <http://www.timberline.ca>
>>
>>    401 · 958 West 8th Avenue  · Vancouver BC · Canada · V5Z 1E5
>>
>>
>>    -----Original Message-----
>>    From: Oscar Zamudio <[email protected] <mailto:[email protected]>>
>>    Date: Thu, 21 Jan 2010 17:14:59
>>    To: PostGIS Users Discussion<[email protected]
>>    <mailto:[email protected]>>
>>    Subject: Re: [postgis-users] Questions about using SRID not -1
>>
>>    _______________________________________________
>>    postgis-users mailing list
>>    [email protected]
>>    <mailto:[email protected]>
>>
>>    http://postgis.refractions.net/mailman/listinfo/postgis-users
>>
>>    _______________________________________________
>>    postgis-users mailing list
>>    [email protected]
>>    <mailto:[email protected]>
>>
>>    http://postgis.refractions.net/mailman/listinfo/postgis-users
>>
>>
>>
>
> --
> Regards,
>
> Chris Hermansen · [email protected] · skype:clhermansen
>
> tel+1.604.714.2878   ·  fax+1.604.733.0631   ·   mob+1.778.840.4625
> Timberline Natural Resource Group Ltd   ·  http://www.timberline.ca
>
> 401  ·  958 West 8th Avenue  ·  Vancouver BC  ·  Canada  ·  V5Z 1E5
>
>
_______________________________________________
postgis-users mailing list
[email protected]
http://postgis.refractions.net/mailman/listinfo/postgis-users

Reply via email to