[Gdal-dev] Basic Pg Question
Brian Hamlin
maplabs at light42.com
Thu Sep 27 14:55:26 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.
>
>
thank you for the tips..
I am a little stuck.. AddGeometryColumn() wants an SRID as "an integer
value reference to an entry in the SPATIAL_REF_SYS table", but the
SPATIAL_REF_SYS table appears to be empty after creating a new
spatially enabled DB from scratch.
also, the last arguement to AddGeometryColumn() , <dimension> isnt
mentioned in the doc I am looking at!
-Brian
>
> 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