def prepareFile(outJSON, featureClass, fileType, includeGeometry): if fileType == "geojson": return prepareGeoJSON(outJSON, featureClass, fileType, includeGeometry) elif fileType == "csv": return prepareCSV(outJSON, featureClass, fileType, includeGeometry) elif fileType == "json": return prepareJSON(outJSON, featureClass, fileType, includeGeometry) elif fileType == "sqlite": return prepareSqlite(outJSON, featureClass, fileType, includeGeometry) else: return False
def prepareFile(outJSON,featureClass,fileType,includeGeometry): if fileType == "geojson": return prepareGeoJSON(outJSON,featureClass,fileType,includeGeometry) elif fileType == "csv": return prepareCSV(outJSON,featureClass,fileType,includeGeometry) elif fileType == "json": return prepareJSON(outJSON,featureClass,fileType,includeGeometry) elif fileType == "sqlite": return prepareSqlite(outJSON,featureClass,fileType,includeGeometry) else: return False
from arcpy import GetParameterAsText from esri2open import writeFile, prepareGeoJSON, closeJSON #compute the peramaters features = GetParameterAsText(0).split(";") outJSON = GetParameterAsText(1) includeGeometry = "geojson" fileType = "geojson" out = prepareGeoJSON(outJSON) first = True #this makes sure sure we arn't missing commas for feature in features: if feature[0] in ("'", '"'): feature = feature[1:-1] writeFile(out, feature, fileType, includeGeometry, first) first = False closeJSON(out)
from arcpy import GetParameterAsText from esri2open import writeFile, prepareGeoJSON, closeJSON #compute the peramaters features = GetParameterAsText(0).split(";") outJSON=GetParameterAsText(1) includeGeometry = "geojson" fileType = "geojson" out=prepareGeoJSON(outJSON) first=True#this makes sure sure we arn't missing commas for feature in features: if feature[0] in ("'",'"'): feature = feature[1:-1] writeFile(out,feature,fileType,includeGeometry, first) first=False closeJSON(out)