Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I created a polygon as follows

create table boundary (id int, name text);

table created;

select AddGeometryColumn ('',boundary', 'latlon' 4326,'POLYGON', 2);

geometry column added;

then i'm trying to insert values as follows

INSERT INTO boundary (id , name, latlon) VALUES ('1', 'river', GeometryFromTerxt('POLYGON(82.240 16.988,82.243 16.991,82.240 16.988)', 4326));

finally i got an error as follow

<--parse error at position (position number) within geometry.

share|improve this question
GeometryFromTerxt is spelt wrong? is that what you actually entered? – iant Oct 22 '12 at 12:23
Also 3 points isn't enough to form a valid polygon, you need a minimum of 4 points. – iant Oct 22 '12 at 12:24
The value of "position number" would be useful, but if your code here is a faithful representation of what you actually did, I would focus on the typo in "Terxt" :-). – whuber Oct 22 '12 at 15:27

As commenters point out

  • You need 4+ points to form a closed polygon
  • The first and last point must be the same
  • Polygons can contain multiple rings, so you need two (()) brackets around your exterior ring point list

For example, the unit square

POLYGON((0 0, 0 1, 1 1, 1 0, 0 0))
share|improve this answer
Thank you very much "Paul Ramsey" finally I created a polygon. My mistake is as you mentioned missing of two braces in POLYGON Feature. – satya chandra Oct 23 '12 at 4:18

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.