[postgis-users] SQL for a GNIS table update and using GeomFromText

Steve Wormley steve at wormley.com
Sat Aug 6 16:02:56 PDT 2005


> 
> TN=# update tngnis SET ploc = GeomFromText('POINT(' || "plongdd"::text
> ||' ' ||  "platdd"::text || ')',4269)   WHERE (plongdd IS NOT NULL) and
> (platdd is NOT NULL) ;
> UPDATE 67926

I believe you could have also done:
update tngnis SET ploc = SetSRID(MakePoint(plongdd,platdd),4269) where
(plongdd is not null) and (platdd is NOT NULL) ;

Although the use of MakePoint and SetSRID may make this less portable to
non-PostGIS systems.

It may be faster as well without the conversions to and from text.

-Steve





More information about the postgis-users mailing list