-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TypeError #5
Comments
I may have fixed it although I'm not entirely sure it's the best approach. It seems like clusterer.py is trying to pass back a set for json serialization. I had to change two lines in compareWithCache. Line 448: It appears that the proper json is now being returned. I'm interested in hearing your opinion on this solution. |
Hi Larry, Line 26: I think Django changed a few things in geodjango since 1.4. Although at first sight I do not see why 1.6 should be a problem, I will install 1.6 and do tests with your exact setup. A further test would be to disable cache when querying: remove the &cache= parameter from the query If the error goes away, we know it is within compareWithCache. By the way: I found out out that, although unsurprisingly, an SSD significantly improves the cluster speed. |
biodiv, I am using PyCharm to develop/debug and my tracing abilities are not
int(gridSize)) ...then it runs and returns a 1. Larry On 2/5/14, 5:06 AM, biodiv wrote:
|
no problem. I can reproduce your error using django 1.6.1. It has something to do with the way django stores sessions since 1.6. We cant use sets in the session. Furthermore I found another error when detecting the SRID of the database. Hopefully I will be able to provide an update to support django 1.6 very soon. |
Please try the new version and let me know if it works for you. clustercache['cellIDs'] = list(clustered_cells) and converted back to a set after retrieving old_cells = set(clustercache['cellIDs']) Your first approach was actually very close... |
Hi,
Larry On 2/5/14, 12:15 PM, biodiv wrote:
|
Thanks a lot for the fix :) btw you can remove the &time=%3E%3D_2012-02-26&is_doubt=%3D_FALSE from your javascript query. I should update the javascript soon, too - it has some smaller parts in it that are specific to the original project it was made for. |
Hi,
I have been trying to get anycluster working for a project I am doing. The error I keep receiving is:
TypeError: set(['1,2', '0,2', '3,2', '2,2']) is not JSON serializable
I'm running Django 1.6.1 Python 2.7.5
I have a psql database with all the relevant extensions installed. The model/field I am using to cluster is defined as follows:
class PlaceMark(models.Model):
name = models.CharField(max_length=255)
description = models.TextField()
geom = models.PointField(srid=4326)
objects = models.GeoManager()
layer = models.ForeignKey(Layer)
def unicode(self):
return self.name
In settings, I have added:
#anycluster settings
ANYCLUSTER_GEODJANGO_MODEL = "locator.PlaceMark"
ANYCLUSTER_COORDINATES_COLUMN = "geom"
The error originates from my main map page. My console shows that the specific page being requested is:
http://localhost:8080/anycluster/kmeans/2/256/?left=-180&top=30.000000000000018&right=180&bottom=30.000000000000018&cache=load&time=%3E%3D_2012-02-26&is_doubt=%3D_FALSE&_=1391549514849
Any ideas?
Thanks,
Larry
The text was updated successfully, but these errors were encountered: