storing lat/long coordinates as points

Stephen Woodbridge woodbri at SWOODBRIDGE.COM
Tue Aug 15 18:09:17 PDT 2006


Ryan Ollerenshaw wrote:
> does anyone know how to store lat/long coordinates in PostgreSQL as POINTS?
> 
Assuming you have PostGIS installed, you might try:

select AddGeometryColumn('schema_name', 'table_name', 'the_geom', 4326, 
'POINT', 2);

the_geom = the column
4326 = SRID for WGS84
'POINT' = Geometry type
2 = the dimension of the point ie (X,Y)

then you can do this:

insert into schema_name.table_name (the_geom) values 
(setsrid(makepoint(long, lat), 4326));

-Steve



More information about the MapServer-users mailing list