How do I use Django to insert a Geometry Field into the database?

Posted by alex on Stack Overflow See other posts from Stack Overflow or by alex
Published on 2010-03-31T04:32:07Z Indexed on 2010/03/31 5:33 UTC
Read the original article Hit count: 295

Filed under:
|
|
|
|
class LocationLog(models.Model):
    user = models.ForeignKey(User)
    utm = models.GeometryField(spatial_index=True)

This is my database model. I would like to insert a row.

I want to insert a circle at point -55, 333. With a radius of 10. How can I put this circle into the geometry field?

Of course, then I would want to check which circles overlap a given circle. (my select statement)

© Stack Overflow or respective owner

Related posts about django

Related posts about python