I'm trying to insert some National Grid references into a Django PointField defined as follows:
oscode = models.PointField(srid=27700, null=True, blank=True)
However, I don't know how to format them correctly in WKT. This is what I get if I try simply using a basic National Grid reference, TR3241
:
INSERT INTO places (placeid, structidx, subidx, county, name, oscode) VALUES ('10', '1', '1', 'Kent', 'Dover', 'TR3241');
psycopg2.InternalError: parse error - invalid geometry
LINE 1: ...'1', 'Kent', 'D1', 'Eastry', 'Bewsbury', 'Dover', 'TR3241', ...
^
HINT: You must specify a valid OGC WKT geometry type such as POINT, LINESTRING or POLYGON
And this is what I get if I (guessing wildly after reading up on WKT!) use POINT(TR3241)
:
psycopg2.InternalError: parse error - invalid geometry
LINE 1: ...'1', 'Kent', 'D1', 'Eastry', 'Bewsbury', 'Dover', 'POINT(TR3...
^
HINT: "POINT(" <-- parse error at position 6 within geometry
How do I format the grid ref correctly?