Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

I'm trying to insert some values into a Geodjango database, but getting errors. This is the table:

class Place(models.Model):
    placeid = models.IntegerField(primary_key=True)
    structidx = models.IntegerField(null=True, blank=True)
    oscode = models.PointField(null=True, blank=True)
    waste86 = models.CharField(max_length=120, null=True, blank=True)
    objects = models.GeoManager()

And this is the code I'm using to insert data:

INSERT INTO domes_place (placeid, structidx, oscode, holding)
  VALUES ('10', '1', '1', 'POINT(632000,141000)', 'N');

And this is the error:

HINT:  "POINT(632000," <-- parse error at position 13 within geometry

Please could someone tell me what I'm doing wrong?

share|improve this question

2 Answers 2

up vote 3 down vote accepted

From looking at the documentation on the Geodjango website, it looks like you don't need the , between the numbers, so give this a try:

INSERT INTO domes_place (placeid, structidx, oscode, holding)
  VALUES ('10', '1', '1', 'POINT(632000 141000)', 'N');

Looks like the missing , is a WKT(Well-Known Text) convention, never noticed it before.

share|improve this answer

No comma: 'POINT(632000 141000)'

See WKT on Wikipedia for a quick reference to Well-Known Text.

share|improve this answer

Your Answer

 
discard

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.