def __init__(self,outFile,featureClass,fileType,includeGeometry, first=True, outName=False): self.outFile = outFile self.fileType = fileType #first we set put the local variables we'll need [self.shp,self.shpType]=getShp(featureClass) self.fields=listFields(featureClass) self.oid=getOID(self.fields) sr=SpatialReference() sr.loadFromString(wgs84) #the search cursor self.rows=SearchCursor(featureClass,"",sr) #don't want the shape field showing up as a property del self.fields[self.shp] self.first=first self.status = statusMessage(featureClass) #define the correct geometry function if we're exporting geometry self.parseGeo = getParseFunc(self.shpType,includeGeometry) self.i=0 if fileType=="geojson": self.parse = self.parseGeoJSON_ElasticSearch elif fileType=="csv": self.parse = self.parseCSV elif fileType=="json": self.parse = self.parseJSON elif fileType=="sqlite": self.parse = self.parseSqlite elif fileType=="topojson": self.parse = self.parseTOPOJSON if outName: self.oName=outName else: self.oName = getName(featureClass) self.topo = self.outFile['topo'].object_factory(self.oName)
def __init__(self, outFile, featureClass, fileType, includeGeometry, first=True): self.outFile = outFile self.fileType = fileType #first we set put the local variables we'll need [self.shp, self.shpType] = getShp(featureClass) self.fields = listFields(featureClass) self.oid = getOID(self.fields) sr = SpatialReference() sr.loadFromString(wgs84) #the search cursor self.rows = SearchCursor(featureClass, "", sr) #don't want the shape field showing up as a property del self.fields[self.shp] self.first = first self.status = statusMessage(featureClass) #define the correct geometry function if we're exporting geometry self.parseGeo = getParseFunc(self.shpType, includeGeometry) self.i = 0 if fileType == "geojson": self.parse = self.parseGeoJSON elif fileType == "csv": self.parse = self.parseCSV elif fileType == "json": self.parse = self.parseJSON elif fileType == "sqlite": self.parse = self.parseSqlite
# Set local variables in_mosaic_dataset = r'C:\Users\geof7015\Documents\ArcGIS\Projects\Leveraging_LiDAR\scratch\SurfaceRasters\SurfaceMosaics.gdb\DTM' resampling_type = "BILINEAR" # "NEAREST", "BILINEAR", "CUBIC", "MAJORITY" input_spatial_reference = "" out_spatial_reference_string = "WGS 1984" geographic_transform = "NAD_1983_To_WGS_1984_5" file_extension = "tif" out_directory = r'' out_mosaic_dataset = r'' # System Parameters out_spatial_reference = SpatialReference(out_spatial_reference_string) else: from arcpy import GetParameterAsText in_mosaic_dataset = GetParameterAsText(0) input_spatial_reference = arcpy.SpatialReference() input_spatial_reference.loadFromString(GetParameterAsText(1)) out_spatial_reference = arcpy.SpatialReference() out_spatial_reference.loadFromString(GetParameterAsText(2)) geographic_transform = GetParameterAsText(3) resampling_type = GetParameterAsText(4) file_extension = GetParameterAsText(5) out_directory = GetParameterAsText(6) out_mosaic_dataset = GetParameterAsText(7) AddMessage(input_spatial_reference) AddMessage(out_spatial_reference) process()