[postgis-users] Convert already loaded table into a spatial table (points)

Fred Lehodey lehodey at gmail.com
Thu Aug 12 11:14:40 PDT 2010


Hi,
ST_MakePoint return point with unknow geometry.
You need to use something like:
ST_SetSRID(ST_MakePoint(x,y,z),<your_srid>)

Fred




On Thu, Aug 12, 2010 at 7:09 PM, Andrea Peri <aperi2007 at gmail.com> wrote:

>
> >I have already loaded a table that contains X, Y and Z values. AT the time of loading it was thought we did not need a spatial component to this table.
> >Now we realize that we do have a need but do not want to reload the 190 million records again and create the point features on load.
>
> >Is it possible to create the point geometry in the existing table....if so, how?
> >Thanks in advance.
> >Tony Appel
>
>
> Assume the X,Y,Z are in three fields in a "tablename" table.
>
> SELECT AddGeometryColumn( 'public','tablename','geom', <epsg>, 'POINT', 3 );
>
> update public.tablename	set geom = ST_MakePoint(X::double,Y::double,Z::double);
>
> epsg is a integer value of your SRS (epsg code)
>
>
> Regards,
>
> --
> -----------------
> Andrea Peri
> . . . . . . . . .
> qwerty àèìòù
> -----------------
>
>
> _______________________________________________
> postgis-users mailing list
> postgis-users at postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-users
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20100812/05c8e824/attachment.html>


More information about the postgis-users mailing list