Search Results

Search found 2 results on 1 pages for 'vaughnkoch'.

Page 1/1 | 1 

  • GeoDjango: is there an out-of-the-box way to generate clusters of points?

    - by vaughnkoch
    Hi, I'm trying to compute clusters on a set of points in Python, using GeoDjango. The problem: Given a set of points, output a set of clusters of those points. (i'm fine specifying # of clusters/cluster size/distance in advance to simplify) There are a few solutions on the web to do clustering, so it's a well known problem. I thought that GeoDjango would handle these types of problems out of the box, but it's not clear how - I've searched the GeoDjango documentation, Google, and a few other places, but couldn't find anything. Before I roll my own clustering solution, I thought I'd ask to see if there's a straightforward way to do this using GEOS or another package within GeoDjango.

    Read the article

  • Easiest way to rename a model using Django/South?

    - by vaughnkoch
    Hi everyone, I've been hunting for an answer to this on South's site, google, and SO, but couldn't find a simple way to do this. I want to rename a Django model using South. Say you have the following: class Foo(models.Model): name = models.CharField() class FooTwo(models.Model): name = models.CharField() foo = models.ForeignKey(Foo) and you want to convert Foo to Bar, namely class Bar(models.Model): name = models.CharField() class FooTwo(models.Model): name = models.CharField() foo = models.ForeignKey(Bar) To keep it simple, I'm just trying to change the name from Foo to Bar, but ignore the 'foo' member in FooTwo for now. What's the easiest way to do this using South? a) I could probably do a data migration, but that seems pretty involved. b) Write a custom migration, e.g. db.rename_table('city_citystate', 'geo_citystate'), but I'm not sure how to fix the foreign key in this case. c) An easier way that you know? Thanks!

    Read the article

1