def createDummyGeorefProcess(self): self.dummyGeorefProcess = createGeoreferenceProcess(71055044, self.dbsession) georefid = self.dummyGeorefProcess.registerGeoreferenceProcess( login, "7440:7246,7280:1534,1216:1454,816:7342", True, "user" ) transaction.commit() return georefid
def __call__(self): log.info("Start processing georeference confirmation request.") try: # parse query parameter and check if they are valide self.__parseQueryParameter__() self.__parseUserId__() # initialize georef process dbsession = self.request.db georeferenceProcess = createGeoreferenceProcess(self.mtbid, dbsession, tmp_dir, log) if hasattr(self, 'georefid'): self.__validateQueryParameterWithGeorefId__() return self.__confirmExistingGeorefProcess__(self.georefid, georeferenceProcess) elif not hasattr(self, 'georefid'): self.__validateQueryParameterWithoutGeorefId__() return self.__registerNewConfirmedGeorefProcess__(georeferenceProcess) else: # error handling log.error("Error while processing georeference confirmation request!") raise except GeoreferenceParameterError as e: log.error('Wrong or missing service parameter - %s'%e) return HTTPBadRequest('Wrong or missing service parameter') except Exception as e: log.error('Problems while computing validation result - %s'%e) return HTTPInternalServerError('Problems while computing validation result')
def __call__(self): log.info("Start processing georeference validation result.") try: # parse query parameter and check if they are valide self.__parseQueryParameter__() self.__validateQueryParameter__() self.__parseUserId__() # initialize georef process dbsession = self.request.db georeferenceProcess = createGeoreferenceProcess(self.mtbid, dbsession, tmp_dir, log) # create validation result and get destination path and georeference id validationResultPath = os.path.join(dest_mapfilefolder,georeferenceProcess.messtischblatt.dateiname+"::"+str(getUniqueId())+".tif") georefId, destPath = georeferenceProcess.fastGeoreference(self.userid,self.points,validationResultPath) # create mapfile for georeference result wms_url = createMapfile(georeferenceProcess.messtischblatt.dateiname, destPath, src_mapfilepath, dest_mapfilefolder, mapfileInitParameter) response = {'wms_url':wms_url,'layer_id':georeferenceProcess.messtischblatt.dateiname,'georefid':georefId} return json.dumps(response, ensure_ascii=False, encoding='utf-8') except GeoreferenceParameterError as e: message = 'Wrong or missing service parameter - %s'%e.value log.error(message) return HTTPBadRequest(message) except Exception as e: message = 'Problems while computing validation result - %s'%e.value log.error(message) return HTTPInternalServerError(message)
def createDummyGeorefProcess(self): self.dummyGeorefProcess = createGeoreferenceProcess( 71055044, self.dbsession) georefid = self.dummyGeorefProcess.registerGeoreferenceProcess( login, '7440:7246,7280:1534,1216:1454,816:7342', True, 'user') transaction.commit() return georefid
def createDummyGeorefProcess(self): self.dummyGeorefProcess = createGeoreferenceProcess( 71055044, self.dbsession) georefid = self.dummyGeorefProcess.registerGeoreferenceProcess( login, '7440:7246,7280:1534,1216:1454,816:7342', False, 'waiting') return georefid
def createDummyGeorefProcess(self): self.dummyGeorefProcess = createGeoreferenceProcess(71055044, self.dbsession) georefid = self.dummyGeorefProcess.registerGeoreferenceProcess(login, '7440:7246,7280:1534,1216:1454,816:7342', False, 'waiting') return georefid