Database Reference
In-Depth Information
Tip
In PostGIS 2.0, you can still use the AddGeometryColumn function if
youwish;however,youneedtosetits use_typmod parameterto false .
6. Now, import the points in the geometric column using the ST_MakePoint
or ST_PointFromText functions(useoneofthefollowingtwoupdatecom-
mands):
postgis_cookbook=> UPDATE chp01.firenews
SET the_geom =
ST_SetSRID(ST_MakePoint(x,y), 4326);
postgis_cookbook=> UPDATE chp01.firenews
SET the_geom = ST_PointFromText('POINT('
|| x || ' ' || y || ')', 4326);
7. Check how the geometry field has been updated in some records from the
table:
postgis_cookbook=# SELECT place,
ST_AsText(the_geom) AS wkt_geom FROM
chp01.firenews ORDER BY place LIMIT 5;
The output of the preceding comment is as follows:
place | wkt
----------------------------------------------------------
Abbaslık |
POINT(29.95...
Abeledos, Montederramo |
POINT(-7.48...
Abreiro |
POINT(-7.28...
Abrunheira, Montemor-o-Velho |
POINT(-8.72...
Achaia |
Search WWH ::




Custom Search