storing lat/long coordinates as points

P Kishor punkish at EIDESIS.ORG
Tue Aug 15 21:16:00 EDT 2006


On 8/15/06, Stephen Woodbridge <woodbri at swoodbridge.com> wrote:
> 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));
>


seriously! this is neat.

You mean, all that converting lon/lat to shapefile and then loading it
into PostGIS is all unnecessary convolutions on my part?


-- 
Puneet Kishor http://punkish.eidesis.org/
Nelson Inst. for Env. Studies, UW-Madison http://www.ies.wisc.edu/
Open Source Geospatial Foundation https://edu.osgeo.org/



More information about the mapserver-users mailing list