def initEPSG(self): '''Read GDAL EPSG files, splitting by NZ(RSR) and RestOfTheWorld''' gcsf = gdal.FindFile('gdal','gcs.csv') if not gcsf: gcsf = os.path.join(self.GD_PATH,'gcs.csv') pcsf = gdal.FindFile('gdal','pcs.csv') if not pcsf: pcsf = os.path.join(self.GD_PATH,'pcs.csv') gcs = ConfigInitialiser.readCSV(gcsf) pcs = ConfigInitialiser.readCSV(pcsf) self.nzlsr = [(e[0],e[0]+' - '+e[3]) for e in gcs if 'NZGD' in e[1] or 'RSRGD' in e[1]] \ + [(e[0],e[0]+' - '+e[1]) for e in pcs if 'NZGD' in e[1] or 'RSRGD' in e[1]] self.rowsr = [(e[0],e[0]+' - '+e[3]) for e in gcs if 'NZGD' not in e[1] and 'RSRGD' not in e[1]] \ + [(e[0],e[0]+' - '+e[1]) for e in pcs if 'NZGD' not in e[1] and 'RSRGD' not in e[1]]
def initConnections(self,uconf,lgval,destname): from lds.TransferProcessor import TransferProcessor #write a refresh CC instead of re initialising the whole object, for use when the dest menu changes #lgval isn't used in CC itself but the gui's use it for menu indexing self.lgval = lgval #Optimisation. If the uconf or dest type are unchanged don't go through the expensive task of updating TP and the layer lists if uconf and destname and ((uconf,destname)!=(self.uconf,self.destname)): #lgpair = (LORG.LAYER if re.match('^v:x',lgval) else LORG.GROUP,lgval) if lgval else (None,None) self.uconf = self._checkUConf(uconf) self.tp = TransferProcessor(self,lgval, None, None, None, None, None, None, uconf) sep = self.reg.openEndPoint(self.SRCNAME, self.uconf) dep = self.reg.openEndPoint(destname, self.uconf) self.tp.setSRC(sep) self.tp.setDST(dep) #svp = Service, Version, Prefix self.svp = self.readProtocolVersion(sep) self.reg.setupLayerConfig(self.tp,sep,dep,self.initlc) #print 'CCt',self.tp #print 'CCd',self.dep if not self.vlayers or self.destname != destname: self.destname = destname self.vlayers = self.getValidLayers(sep,dep) self.setupReservedLayerList() self.setupAssignedLayerList() self.buildLayerGroupList() self.inclayers = [self.svp['idp']+x[0] for x in ConfigInitialiser.readCSV()] #self.reg.closeLayerConfig(dep) self.reg.closeEndPoint(destname) self.reg.closeEndPoint(self.SRCNAME) sep,dep = None,None elif destname and not uconf: raise ConnectionConfigurationException('Missing configuration, "{}.conf"'.format(uconf)) elif uconf and not destname: raise ConnectionConfigurationException('No driver/dest specified "{}"'.format(destname))
def initConf(self): '''Read files in conf dir ending in conf''' self.cflist = ConfigInitialiser.getConfFiles() #self.imgset = self.STATIC_IMG if ConfigWrapper().readDSProperty('Misc','indicator')=='static' else self.ANIM_IMG #self.imgset = self.STATIC_IMG if self.parent.confconn.tp.src.confwrap.readDSProperty('Misc','indicator')=='static' else self.ANIM_IMG sep = self.parent.confconn.reg.openEndPoint(self.parent.confconn.SRCNAME,self.parent.confconn.uconf) self.imgset = self.STATIC_IMG if sep.confwrap.readDSProperty('Misc','indicator')=='static' else self.ANIM_IMG self.parent.confconn.reg.closeEndPoint(self.parent.confconn.SRCNAME)
def initConnections(self, uconf, lgval, destname): from lds.TransferProcessor import TransferProcessor #write a refresh CC instead of re initialising the whole object, for use when the dest menu changes #lgval isn't used in CC itself but the gui's use it for menu indexing self.lgval = lgval #Optimisation. If the uconf or dest type are unchanged don't go through the expensive task of updating TP and the layer lists if uconf and destname and ((uconf, destname) != (self.uconf, self.destname)): #lgpair = (LORG.LAYER if re.match('^v:x',lgval) else LORG.GROUP,lgval) if lgval else (None,None) self.uconf = self._checkUConf(uconf) self.tp = TransferProcessor(self, lgval, None, None, None, None, None, None, uconf) sep = self.reg.openEndPoint(self.SRCNAME, self.uconf) dep = self.reg.openEndPoint(destname, self.uconf) self.tp.setSRC(sep) self.tp.setDST(dep) #svp = Service, Version, Prefix self.svp = self.readProtocolVersion(sep) self.reg.setupLayerConfig(self.tp, sep, dep, self.initlc) #print 'CCt',self.tp #print 'CCd',self.dep if not self.vlayers or self.destname != destname: self.destname = destname self.vlayers = self.getValidLayers(sep, dep) self.setupReservedLayerList() self.setupAssignedLayerList() self.buildLayerGroupList() self.inclayers = [ self.svp['idp'] + x[0] for x in ConfigInitialiser.readCSV() ] #self.reg.closeLayerConfig(dep) self.reg.closeEndPoint(destname) self.reg.closeEndPoint(self.SRCNAME) sep, dep = None, None elif destname and not uconf: raise ConnectionConfigurationException( 'Missing configuration, "{}.conf"'.format(uconf)) elif uconf and not destname: raise ConnectionConfigurationException( 'No driver/dest specified "{}"'.format(destname))
def parseCapabilitiesDoc(cls,capabilitiesurl,wfs_ver,file_json,pxy,idp): '''Class method returning the capabilities doc as requested, in either JSON or CP format''' return ConfigInitialiser.buildConfiguration(capabilitiesurl,wfs_ver,file_json,idp)