コード例 #1
0
def drawKMLsForUserCooccurenceGraph(minEdgeWeight=30):
    kml = SpotsKML()
    i=1
    for edge in FileIO.iterateJsonFromFile(locationGraph):
        if edge['w']>=minEdgeWeight: kml.addLine(getLocationPairs(edge['e']), description=str(edge['w'])); i+=1
        if i==10000: break
    kml.write(userBasedSpotsKmlsFolder+'%s.kml'%minEdgeWeight)
コード例 #2
0
ファイル: places1.py プロジェクト: kykamath/users_and_geo
 def writeClusterKML():
     kml = SpotsKML()
     outputKMLFile='%s/clusters.kml'%placesAnalysisFolder%place['name']
     for data in FileIO.iterateJsonFromFile(placesUserClusterFeaturesFile%place['name']):
         clusterId, color, features = data
         kml.addLocationPointsWithTitles([(getLocationFromLid(f[0].replace('_', ' ')), f[2]) for f in features[:noOfFeatures]], color=color)
         FileIO.createDirectoryForFile(outputKMLFile)
         kml.write(outputKMLFile)
コード例 #3
0
ファイル: places.py プロジェクト: kykamath/users_and_geo
def writeUserClusterKMLs(place):
    clustering = getUserClustering(place, place.get('k'))
    colorMap = clustering[3]
    for clusterId, details in sorted(getUserClusteringDetails(place, clustering).iteritems(), key=lambda k: int(k[0])):
        kml = SpotsKML()
        kml.addLocationPointsWithTitles([(getLocationFromLid(lid), unicode(name).encode('utf-8')) for lid, name, _ in details['locations'][:5]], color=colorMap[clusterId])
        outputKMLFile=placesKMLsFolder%place['name']+'locations/userClusters/%s/%s.kml'%(str(clustering[0]), str(clusterId))
        FileIO.createDirectoryForFile(outputKMLFile)
        kml.write(outputKMLFile)
コード例 #4
0
 def drawKMLsForUserBasedDisjointFrequentLocationItemsets(
     minLocationsTheUserHasCheckedin, minUniqueUsersCheckedInTheLocation, minCalculatedSupport, **kwargs
 ):
     SpotsKML.drawKMLsForSpotsWithPoints(
         iterateDisjointFrequentLocationItemsets(
             minLocationsTheUserHasCheckedin, minUniqueUsersCheckedInTheLocation, minCalculatedSupport, **kwargs
         ),
         "fi_disjoint_%s_%s_%s.kml"
         % (minLocationsTheUserHasCheckedin, minUniqueUsersCheckedInTheLocation, minCalculatedSupport),
         title=True,
     )
コード例 #5
0
 def drawKMLsForUserBasedOnItemsetClustering(
     minLocationsTheUserHasCheckedin,
     minUniqueUsersCheckedInTheLocation,
     minCalculatedSupport,
     initialNumberofLocationsInSpot,
     **kwargs
 ):
     SpotsKML.drawKMLsForSpotsWithPoints(
         iterateSpotsByItemsetClustering(
             minLocationsTheUserHasCheckedin,
             minUniqueUsersCheckedInTheLocation,
             minCalculatedSupport,
             initialNumberofLocationsInSpot,
             **kwargs
         ),
         "fi_itemset_clustering_%s_%s_%s.kml"
         % (minLocationsTheUserHasCheckedin, minUniqueUsersCheckedInTheLocation, minCalculatedSupport),
         title=True,
     )
コード例 #6
0
 def writeAsKML(): SpotsKML.drawKMLsForSpotsWithPoints(UserGraphSpots.iterateSpots(), '%s.kml'%(UserGraphSpots.getSpotsFile()), title=True)
 @staticmethod
コード例 #7
0
 def writeAsKML(): 
     print 'Writing', '%s.kml'%RadiusSpots.getSpotsFile()
     SpotsKML.drawKMLsForSpotsWithPoints(RadiusSpots.iterateSpots(), '%s.kml'%(RadiusSpots.getSpotsFile()), title=True)
コード例 #8
0
 def writeAsKML(): SpotsKML.drawKMLsForSpotsWithPoints(FrequentItemSpots.iterateSpots(), '%s.kml'%(FrequentItemSpots.getSpotsFile()), title=True)
 @staticmethod
コード例 #9
0
def drawKMLsForUserBasedSpotsUsingClustering(inflation=15, minLocations=10):
    SpotsKML.drawKMLsForSpots(spotsUsingClusteringIterator(inflation, minLocations), userBasedSpotsUsingClusteringKmlsFolder+'%s_%s.kml'%(inflation, minLocations))
コード例 #10
0
 def radius(minLocationsTheUserHasCheckedin, minUniqueUsersCheckedInTheLocation, radiusInMiles):
     SpotsKML.drawKMLsForSpotsWithPoints(
         iterateSpotsUsingRadius(minLocationsTheUserHasCheckedin, minUniqueUsersCheckedInTheLocation, radiusInMiles),
         "radius_%s_%s.kml" % (minLocationsTheUserHasCheckedin, minUniqueUsersCheckedInTheLocation),
         title=True,
     )
コード例 #11
0
 def drawKMLsForLocationsFromAllTransactions(minLocationsTheUserHasCheckedin, minUniqueUsersCheckedInTheLocation):
     SpotsKML.drawKMLsForPoints(
         locationsFromAllTransactionsIterator(minLocationsTheUserHasCheckedin, minUniqueUsersCheckedInTheLocation),
         "all_locations_%s_%s.kml" % (minLocationsTheUserHasCheckedin, minUniqueUsersCheckedInTheLocation),
         color="#E38FF7",
     )