Exemplo n.º 1
0
 def mapParcellings(self, line):
     if not self.mapIsinsubdivision(line):
         return []
     auth_date = normalizeDate(self.getData('DateLot'))
     approval_date = normalizeDate(self.getData('DateLotUrbanisme'))
     raw_city = self.getData('AncCommune')
     city = raw_city.split('-')
     keywords = [approval_date] + city
     if raw_city or approval_date:
         parcellings = self.catalog(Title=keywords)
         if len(parcellings) == 1:
             return parcellings[0].getObject().UID()
         keywords = [auth_date] + city
         parcellings = self.catalog(Title=keywords)
         if len(parcellings) == 1:
             return parcellings[0].getObject().UID()
         self.logError(self, line, 'Couldnt find parcelling or found too much parcelling', {'approval date': approval_date, 'auth_date': auth_date, 'city': raw_city})
     return []
Exemplo n.º 2
0
 def mapPca(self, line):
     if not self.mapIsinpca(line):
         return []
     pca_date = normalizeDate(self.getData('DatePPA'))
     pcas = self.catalog(Title=pca_date)
     if len(pcas) != 1:
         self.logError(self, line, 'Couldnt find pca or found too much pca', {'date': pca_date})
         return []
     return pcas[0].id
Exemplo n.º 3
0
 def mapPca(self, line):
     if not self.mapIsinpca(line):
         return []
     pca_date = normalizeDate(self.getData("dateppa"))
     pcas = self.catalog(Title=pca_date)
     if len(pcas) != 1:
         self.logError(self, line, "Couldnt find pca or found too much pca", {"date": pca_date})
         return []
     return pcas[0].id
Exemplo n.º 4
0
    def mapPcadetails(self, line):
        details = ""

        if self.mapIsinpca(line):
            pca_date = normalizeDate(self.getData("dateppa"))
            pcas = self.catalog(Title=pca_date)
            if len(pcas) != 1:
                details = pca_date + " " + self.getData("refppa")

        if not self.mapPcazone(line):
            details = "{details}\n{pcazone}".format(details=details, pcazone=self.getData("zonepca"))

        return details