[postgis-users] entering map references
Mark Cave-Ayland
mark.cave-ayland at ilande.co.uk
Sun Oct 22 08:40:10 PDT 2006
On Wed, 2006-10-18 at 12:19 +0100, David Potts wrote:
> Hi
>
> I am trying to enter a series of points in to a Postgis database.
>
> I am new at this, my points are expressed in the British National Grid
>
> If I use the correct correct SRI entry for British National Grid, ie
> 27700, convert the grid refeerence to a Easting & Northing.
>
> Are the Eastings and Northings the correct values for x y values of the
> Point class?
>
> e.g. HU396753 to 439668,1175316.
>
> Select AddGeometryColumn('theTable','theCol', 27700,'POINT',1);
>
> Are the Eastings and Northings the correct values for x y values of the
> Point class?
Hi David,
The correct values for the coordinates within the UK are eastings and
northings, e.g. 439668 1175316. Note that in your example above, you
would not be able to insert your points into "theTable" since you have
specified the geometry column as being one dimensional, and types in
PostGIS are a minimum of two dimensions.
The following commands in pgAdmin/psql should help get you started - be
sure to substitute the CREATE TABLE definition with one you are
currently using:
CREATE TABLE theTable ( .. etc. ..);
SELECT AddGeometryColumn('theTable','theCol', 27700, 'POINT', 2);
INSERT INTO theTable (theCol) VALUES (setSRID(MakePoint(438668,
1175316), 27700));
SELECT AsText(theCol) FROM theTable;
Note that if are new to PostgreSQL/PostGIS it is recommended that you
keep all table names/column names in lower case to avoid having to quote
mixed-case table/column names in some instances.
HTH,
Mark.
More information about the postgis-users
mailing list