def __open(self): self.dataObj = shp_file(self.dataPath) self.header = self.dataObj.header self.bbox = self.dataObj.bbox try: self.type = STRING_TO_TYPE[self.dataObj.type()] except KeyError: raise TypeError("%s does not support shapes of type: %s" % (self.__class__.__name__, self.dataObj.type()))
def __open(self): self.dataObj = shp_file(self.dataPath) self.header = self.dataObj.header self.bbox = self.dataObj.bbox try: self.type = STRING_TO_TYPE[self.dataObj.type()] except KeyError: raise TypeError('%s does not support shapes of type: %s' % (self.__class__.__name__, self.dataObj.type()))
def __firstWrite(self, shape): self.type = TYPE_TO_STRING[type(shape)] if self.type == 'POINT': if len(shape) == 3: self.type = 'POINTM' if len(shape) == 4: self.type = 'POINTZ' self.dataObj = shp_file(self.dataPath, 'w', self.type) self.write = self.__writer self.write(shape)
def __firstWrite(self, shape): self.type = TYPE_TO_STRING[type(shape)] if self.type == "POINT": if len(shape) == 3: self.type = "POINTM" if len(shape) == 4: self.type = "POINTZ" self.dataObj = shp_file(self.dataPath, "w", self.type) self.write = self.__writer self.write(shape)