Beispiel #1
0
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
Beispiel #2
0
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
Beispiel #3
0
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)
Beispiel #4
0
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)