[Gdal-dev] Basic Pg Question

Matthew Perry perrygeo at gmail.com
Thu Sep 27 04:57:13 EDT 2007


Brain,

 The "best" way would be to

1) install postgis in your pg database if you have not done so already.
2) Create a point geometry column in your table using AddGeometryColumn()
3) Do an update with the postgis MakePoint() function (ie UPDATE table
SET geom = SETSRID(MakePoint(lon, lat),4326) )

The SETSRID(.., 4326) function is used to define the resulting
geometry as geographic coordinates with a WGS84 datum. If your
coordinate system is different, you'll need to use the proper spatial
reference id code.

- matt

On 9/27/07, Brian Hamlin <maplabs at light42.com> wrote:
> If I have a database with a table, and that table has fields Latitude
> and Longitude, in double precision. What are some ways I can enable OGR
> to see that as a Point?  I am asking for all the steps.. I assume there
> are many ways to begin
>
> thanks in advance
>    -Brian
>
>
>
>
> _______________________________________________
> Gdal-dev mailing list
> Gdal-dev at lists.maptools.org
> http://lists.maptools.org/mailman/listinfo/gdal-dev
>


-- 
Matthew T. Perry
http://www.perrygeo.net

"Never ascribe to malice, that which can be adequately explained by
incompetence."



More information about the Gdal-dev mailing list