Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

started new clustering method

  • Loading branch information...
commit 9ac961d2beb0a2611b27a070880709dffc5d53f9 1 parent 0b4e995
jrasky jrasky authored

Showing 2 changed files with 10 additions and 6 deletions. Show diff stats Hide diff stats

  1. +6 3 TODO.txt
  2. +4 3 geocamLayer/management/commands/restruct.py
9 TODO.txt
@@ -4,6 +4,8 @@ Todo list for geocamlayer
4 4
5 5 - Figure out clustering, once and for all.
6 6
  7 +- Use JQuerry moar
  8 +
7 9 - Actually get kml working
8 10 - Top level link that will load the kml in gearth and do the right stuff
9 11
@@ -23,10 +25,11 @@ Done list
23 25 - make install process as easy as possible
24 26
25 27 Bug List
26   -
27   -- tile loading is still tempremental
28   - - this has gotten better, still not very good
29 28 - clustering has issues
30 29 - as the zoom level increases, it gets worse
31 30 - points are not showing up consistently for some reason
32 31 - Clusters are still being weird
  32 +
  33 +possibilities
  34 +
  35 +- not having indent = 4 on the json
7 geocamLayer/management/commands/restruct.py
@@ -12,16 +12,17 @@
12 12 NUMBER_ZOOMS = 10
13 13
14 14 class Cluster(object):
15   - def __init__(self, finalZoom = False):
  15 + def __init__(self, finalZoom = False, cluster=True):
16 16 self.numPoints = 0
17 17 self.xSum, self.ySum = 0,0
18 18 self.south = self.west = self.east = self.north = None
19 19 self.points = []
20 20 self.finalZoom = finalZoom
  21 + self.cluster = cluster
21 22
22 23 def add_point(self, point):
23 24 self.numPoints += 1
24   - if self.numPoints == 1 or self.finalZoom:
  25 + if self.numPoints == 1 or self.finalZoom or not self.cluster:
25 26 self.points.append(point)
26 27 else:
27 28 self.points = []
@@ -39,7 +40,7 @@ def add_point(self, point):
39 40
40 41 def get_json(self):
41 42 data = []
42   - if self.numPoints > 1 and not self.finalZoom:
  43 + if self.numPoints > 1 and not self.finalZoom and self.cluster:
43 44 data.append({'type': 'Feature',
44 45 'geometry': {
45 46 'type': 'Point',

0 comments on commit 9ac961d

Please sign in to comment.
Something went wrong with that request. Please try again.