<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#333399">
Thanks!  This will definitely help!  BTW, I am using PostGIS 1.0.0. 
The PostGIS manual lists the SetSRID as having only one arg, which is
why I was having so much trouble.  It never occurred to me that it was
a documentation bug!  That should have been the first place I looked!<br>
<br>
Mark<br>
<br>
Nicolas Ribot wrote:
<blockquote cite="mid28de5e310506290952226261b9@mail.gmail.com"
 type="cite">
  <pre wrap="">On 6/29/05, Mark Fenbers <a class="moz-txt-link-rfc2396E" href="mailto:Mark.Fenbers@noaa.gov"><Mark.Fenbers@noaa.gov></a> wrote:
  </pre>
  <blockquote type="cite">
    <pre wrap="">I have discovered this morning that data that I've loaded into the DB
using shp2pgsql was imported with the wrong SRID specified.  Some of the
tables have been modified since importing them, so merely re-importing
them with the correct SRID is not going to be a simple solution.

Now I'm trying to change the SRID for these tables but I am running into
some headaches.  Basically, the data now is incorrectly stored as
SRID=4326 and I want to change the SRID to 4269 without transforming any
of the actual geometries.  I've gotten all tied in knots as to how to
formulate a proper query to do this.

Logically, I want to do this:

update mytable set SRID = 4269 where SRID(the_geom) = 4326;

What's really throwing me off is that the setSRID() function only takes
one argument (geometry) instead of the two that seems more logical to me
-- as in setSRID(the_geom, 4269).  If this were the case, I could
probably run this:

select setSRID(the_geom,4269) from myTable where SRID(the_geom) = 4326;

Anyone know the RIGHT WAY to do what I need to do?

Mark

    </pre>
  </blockquote>
  <pre wrap=""><!---->
Hello,
You should first change the SRID in the postgis metadata
(geometry_columns table).
Try this function:

select updategeometrysrid('your_table', 'geom_col', <new_srid>);

Then, use setSRID to change geometries internal SRID:

select setsrid(geom_col, <new_srid>) from your_table;

By the way you should have the 2-arguments setSRID function.
If not you should check your postgis version.

Nicolas
_______________________________________________
postgis-users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:postgis-users@postgis.refractions.net">postgis-users@postgis.refractions.net</a>
<a class="moz-txt-link-freetext" href="http://postgis.refractions.net/mailman/listinfo/postgis-users">http://postgis.refractions.net/mailman/listinfo/postgis-users</a>

  </pre>
</blockquote>
</body>
</html>