class BuildingInBuilding :

    BUILDING_INSIDE_BUILDING = 2001;

    def __init__ (self):
        self.primitivesToCheck = LinkedList();
        self.index = QuadBuckets();

        print 'building in building'
        #super(tr("Building inside building"), tr("Checks for building areas inside of buildings."));
    

    def visitn(self,n) :

#        print "visitn:"
#        print n

        if (n.isUsable() and isBuilding(n)) :
            if not self.primitivesToCheck.contains(n):
#                print "adding  :"  n 
                self.primitivesToCheck.add(n);
            else:
                print "duplicate p :" 
#                print n

    def visitw(self,w) :
        print "visitw:"
#        print w

        if (w.isUsable() and w.isClosed() and isBuilding(w)) :
            self.primitivesToCheck.add(w)
            self.index.add(w)
            print "added"

    def isInPolygon(n, polygon) :
        return Geometry.nodeInsidePolygon(n, polygon);
    
    def sameLayers( w1, w2) :
        if w1.get("layer") is not None :
            l1 = w1.get("layer") 
        else :
            l1 = "0";

        if  w2.get("layer") is not None :
            l2 = w2.get("layer") 
        else : 
            l2 ="0";
        return l1.equals(l2);
    
    def evaluateNode(self,p,obj):
        print "te"
#        print p
#        print obj

    def endTest2(self):
        for p in self.primitivesToCheck :
            collection = self.index.search(p.getBBox())

            for object in collection:
                if (not p.equals(object)):              
                    if (isinstance(p,Node)):
                        self.evaluateNode(p, object)
                    else :
                        print p
            #         else if (p instanceof Way)
            #             return evaluateWay((Way) p, object);
            #         else if (p instanceof Relation)
            #             return evaluateRelation((Relation) p, object);
            #         return false;

    def endTest(self) :
        print "end"
#        bbox =  BBox(-180,-90,180,90)
        bbox =  BBox(-1000,-900,1800,900)
        print self.index
        collection = self.index.search(bbox)
#        print collection
        DisplayTable(self.primitivesToCheck)
Example #2
0
            serv = ForeignServer(sName, name, install, host)
            rule = ExclusionRule('Cluster', 'name', cName)
            for http in httpList:
                ssl = AdminConfig.showAttribute(http, "sslEnabled")
                if ssl == "true":
                    id = 'HTTPS'
                else:
                    id = 'HTTP'
                address = AdminConfig.showAttribute(http, "address")
                httpHost = AdminConfig.showAttribute(address, "host")
                port = AdminConfig.showAttribute(address, "port")
                transport = TransportDefinition(id, httpHost, port)
                serv.addTransportDefinition(transport)
            if cName != 'None' and not exclude.contains(rule):
                cServer = ClusteredForeignServer(cName, "123456789", serv)
                if not ignore.contains(cName):
                    writer.addClusteredServerEntry(cServer, 0)
                continue
            # ignore check should be placed at beginning for efficiency
            if not ignore.contains(sName):
                writer.addServerEntry(serv, 0)

# Discover & record installed applications

apps = AdminApp.list().split(lineSeperator)

module = "MODULE"
exclude = rules.getExclusionRulesForType("Application")
for app in apps:
    clusterTargets = LinkedList()
    serverTargets = LinkedList()