<span class="Apple-style-span" style="font-family: arial, sans-serif; font-size: 13px; border-collapse: collapse; "><div>I already tried this way:</div><div><br></div><div>UPDATE mypoints SET the_geom = ST_SetSRID(the_geom,4326);</div>
<div><br></div><div>But I got:</div><div><br></div><div>ERROR:  Operation on two GEOMETRIES with different SRIDs</div><div><br></div><div>And I already left clear that there's no such different SRIDs as the values are well in the range of 4326 spatial reference. Maybe.... and I am thinking out loud, the extreme values I am using are the problems. I will check later if a latitude strictly equal to -90 is a problem and a proper value must be -89.9999 for example....</div>
<div><br></div></span><br><div class="gmail_quote">On Thu, Jan 21, 2010 at 4:39 PM, Kevin Neufeld <span dir="ltr"><<a href="mailto:kneufeld@refractions.net">kneufeld@refractions.net</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
Hi Oscar,<br>
<br>
Yes, this is definitely possible.  Using your example...<br>
<br>
CREATE TABLE mydistance (the_geom geometry, the_name text);<br>
\d mydistance<br>
    Table "public.mydistance"<br>
  Column  |   Type   | Modifiers<br>
----------+----------+-----------<br>
 the_geom | geometry |<br>
 the_name | text     |<br>
<br>
<br>
-- Insert without using an explicit SRID<div class="im"><br>
INSERT INTO mydistance (the_geom, the_name)<br>
   VALUES (ST_GeomFromText('POINT(-58.0 0.0)'),'Punto 1-1');<br>
<br></div>
SELECT ST_SRID(the_geom), ST_AsText(the_geom) FROM mydistance ;<br>
 st_srid |  st_astext<br>
---------+--------------<br>
      -1 | POINT(-58 0)<br>
(1 row)<br>
<br>
<br>
-- specify the srid of all the geometries<br>
UPDATE mydistance SET the_geom = ST_SetSRID(the_geom, 4326);<br>
<br>
SELECT ST_SRID(the_geom), ST_AsText(the_geom) FROM mydistance ;<br>
 st_srid |  st_astext<br>
---------+--------------<br>
    4326 | POINT(-58 0)<br>
(1 row)<br>
<br>
<br>
-- update geometry_columns (inserts appropriate row and adds appropriate constraints to your spatial table)<br>
SELECT populate_geometry_columns('mydistance'::regclass);<br>
\d mydistance<br>
    Table "public.mydistance"<br>
  Column  |   Type   | Modifiers<br>
----------+----------+-----------<br>
 the_geom | geometry |<br>
 the_name | text     |<br>
Check constraints:<br>
    "enforce_dims_the_geom" CHECK (ndims(the_geom) = 2)<br>
    "enforce_geotype_the_geom" CHECK (geometrytype(the_geom) = 'POINT'::text OR the_geom IS NULL)<br>
    "enforce_srid_the_geom" CHECK (srid(the_geom) = 4326)<br>
<br>
SELECT * FROM geometry_columns WHERE f_table_name = 'mydistance';<br>
 f_table_catalog | f_table_schema | f_table_name | f_geometry_column | coord_dimension | srid | type<br>
-----------------+----------------+--------------+-------------------+-----------------+------+-------<br>
                 | public         | mydistance   | the_geom          |               2 | 4326 | POINT<br>
(1 row)<br>
<br>
<br>
Does this help?<br>
Cheers,<br><font color="#888888">
Kevin</font><div class="im"><br>
<br>
On 1/21/2010 11:08 AM, Oscar Zamudio wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
I already stated that this is only an experiment trying to solve the problem because my customer already loaded a<br>
lot of data WITHOUT expliciting SRID reference..... I mean,<br>
<br>
INSERT INTO mydistance (the_geom, the_name) VALUES (ST_GeomFromText('POINT(-58.0 0.0)',4326),'Punto 1-1');<br>
<br>
Is a step without SRID value that was taken years ago on their database. I'm trying to avoid the reloading process<br>
and taking in account that there are some functions that probably can make the task,,, I began to explore them<br>
without success up to now.<br>
<br>
Regards,<br>
<br>
</blockquote></div><div><div></div><div class="h5">
_______________________________________________<br>
postgis-users mailing list<br>
<a href="mailto:postgis-users@postgis.refractions.net" target="_blank">postgis-users@postgis.refractions.net</a><br>
<a href="http://postgis.refractions.net/mailman/listinfo/postgis-users" target="_blank">http://postgis.refractions.net/mailman/listinfo/postgis-users</a><br>
</div></div></blockquote></div><br>