[postgis-users] Projection...

strk at refractions.net strk at refractions.net
Thu Sep 22 07:53:17 PDT 2005


On Thu, Sep 22, 2005 at 04:36:22PM +0200, Nicolas Ribot wrote:
> > Hi,
> >
> > I have some data from USA in 'NAD83 Nevada East' fromat (EPSG:32107 -
> > ?). I want to change it to WGS84 (EPSG:4326) using PostGIS. When I use:
> >
> > "select updategeometrysrid('table', 'the_geom', 4326);" resulting values
> > are'nt correct. What am I doing wrong?
> >
> > Thanks in advance for your replies.
> >
> > Best regards
> > Wacek
> >
> 
> Hi Wacek,
> 
> calling updategeometrysrid only changes the internal geometries SRID.
> It does not reproject them.
> You have to explicitly transform the geometries from the source
> coordinates system to the target one, using the tranform() function.
> 
> select transform(the_geom, 4326) from table;
> 
> You can either create a new table containing the transformed
> geometries, or drop SRID constraint on your table, transform the
> geometries and re-add the SRID constraint adapted to the new
> geometries' SRID

Or:
	SELECT updateGeometrySRID('mytable', 'the_geom', 4326);
	UPDATE mytable set the_geom =
		transform(SetSRID(the_geom, 32107), 4326);

--strk;



More information about the postgis-users mailing list