Comments (7)
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:
new_clustercells = list(clustercells)-old_cells
Line 453:
clustered_cells = list(clustercells)
It appears that the proper json is now being returned. I'm interested in hearing your opinion on this solution.
Larry
from anycluster.
Hi Larry,
thank you for your report!
python cannot subtract lists, so we need to use sets. You might get errors when panning the map.
Have you tried to change the following line in views.py :
Line 26:
list(markers)
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.
As this might take a few days until I find the time to do it, please try the above first if you get errors when panning.
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.
from anycluster.
biodiv,
Thanks for getting back to me. I am a novice in Python and I am still
learning it so bear with me. I have a programming background so I
understand the principals but I still don't have a firm grasp on syntax
and behavior. That being said, I did try to set things back in
clusterer.py to the way they were and then tried to json.dump
list(markers) instead of just markers but I received the same error.
I am using PyCharm to develop/debug and my tracing abilities are not
great. What I did notice though is that it never makes it to Line 26 in
views.py. It appears that things are crashing out in clusterer.py. I
tested this by simply placing a 1 on line 26 instead of markers. I
still get the same error. If I comment out the two previous calls to:
clustercells, filters =
clusterer.getClusterParameters(request,int(zoom),int(gridSize))
markers = clusterer.kmeansCluster(clustercells,filters,int(zoom),
int(gridSize))
...then it runs and returns a 1.
Larry
On 2/5/14, 5:06 AM, biodiv wrote:
Hi Larry,
thank you for your report!
python cannot subtract lists, so we need to use sets. You might get
errors when panning the map.
Have you tried to change the following line in views.py :Line 26:
list(markers)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.
As this might take a few days until I find the time to do it, please
try the above first if you get errors when panning.A further test would be to disable cache when querying: remove the
&cache= parameter from the queryIf 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.—
Reply to this email directly or view it on GitHub
#5 (comment).
from anycluster.
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.
from anycluster.
Please try the new version and let me know if it works for you.
The cache is now stored as list:
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...
from anycluster.
Hi,
I updated clusterer.py and was getting an error because srid_sb was not
being set. I am using 4326. I tried it with and without adding the new
setting you mentioned in your readme. I made a change and it worked.
Here's what I did on line 876:
if len(list(srid_db_objs)) > 0:
srid_db = srid_db_objs[0].st_srid else: try: srid_db = settings.ANYCLUSTER_COORDINATES_COLUMN_SRID except: srid_db = 4326
Larry
On 2/5/14, 12:15 PM, biodiv wrote:
Please try the new version and let me know if it worked for you
—
Reply to this email directly or view it on GitHub
#5 (comment).
from anycluster.
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.
from anycluster.
Related Issues (20)
- Pin Images HOT 1
- request: Include demo app in repo HOT 1
- Possible Bug in kmeansCluster(self, clustercells, filters) HOT 7
- markerFinalClickFunction on single marker HOT 1
- Question - Markers in Viewport HOT 4
- clusterPopup.html override HOT 2
- Viewport and Pincount HOT 5
- Filter docs HOT 2
- Change separator in parseFilters method HOT 4
- csrf HOT 2
- ST_WITHIN HOT 5
- Reporting HOT 4
- Viewport as geojson HOT 2
- Compatibilty with mysql HOT 9
- Application integration with pip install HOT 1
- Demo is not running HOT 3
- Ambiguity with filters, array or dict. Suggestion HOT 5
- Demo doesn't work HOT 1
- Expose anycluster-client filter types HOT 1
- get_map_content_counts requires nested sql statement HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from anycluster.