Пример #1
0
 def transition_import_commune(self):
     shapefile = ShapeUnzip.getShapefile(self.start.shapefile)
     debug("unzipped")
     try :            
         Commune.createCommuneGeometries(shapefile.filename,
                                        self.start.version)
     finally:
         shapefile.destroy()
     return 'done'
Пример #2
0
 def transition_import_departement(self):
     shapefile = ShapeUnzip.getShapefile(self.start.shapefile)
     debug("unzipped")
     try :            
         Departement.createDepartementGeometries(shapefile.filename,
                                        self.start.version)
     finally:
         shapefile.destroy()
     return 'done'
Пример #3
0
 def importerCommune(cls, data, version):
     binData = base64.decodestring(data)
     shapefile = ShapeUnzip.getShapefile(binData)
     ret = False
     try :
         Commune.deleteOldCommune()
         Commune.createCommuneGeometries(shapefile.filename,
                                        version)
         ret = True
     finally:
         shapefile.destroy()
     return ret
Пример #4
0
 def importerRegion(cls, data, version):
     binData = base64.decodestring(data)
     shapefile = ShapeUnzip.getShapefile(binData)
     ret = False
     try :
         Region.deleteOldRegion()
         Region.createRegionGeometries(shapefile.filename,
                                        version)
         ret = True
     finally:
         shapefile.destroy()
     return ret
Пример #5
0
 def importerDepartement(cls, data, version):
     binData = base64.decodestring(data)
     shapefile = ShapeUnzip.getShapefile(binData)
     ret = False
     try :
         Departement.deleteOldDepartement()
         Departement.createDepartementGeometries(shapefile.filename,
                                        version)
         ret = True
     finally:
         shapefile.destroy()
     return ret