[Gdal-dev] Basic Pg Question

Brian Hamlin maplabs at light42.com
Wed Oct 10 02:12:38 EDT 2007


On Sep 27, 2007, at 1:57 AM, Matthew Perry wrote:
>
> 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

It turns out that the BostonGIS group has a tutorial cheat sheet on 
this exact topic
http://www.bostongis.org/?content_name=postgis_tut03

very good ogr cheat sheet there, too

-Brian




More information about the Gdal-dev mailing list