except Exception as e: print __doc__ print "---- error:" print str(e) sys.exit() #pprint.pprint(base) #pprint.pprint(query) tmpfile = getRawData("https://"+host, username, pas, query=query, tz=tz, force_sync_request=force_sync_request) saved = [] if 'geojson' in formats: data = tsvToGeoJSON(tmpfile) fname = ofile+".geojson" with open(fname, "w") as f: f.write(geojson.dumps(data)) saved.append(fname) if 'shape' in formats: tsvToShape(tmpfile,ofile) saved.append(ofile) if "tsv" in formats: fname = ofile+".tsv"
force_sync_request = True else: force_sync_request = False except Exception as e: print __doc__ print "---- error:" print str(e) sys.exit() #pprint.pprint(base) #pprint.pprint(query) tmpfile = getRawData("https://" + host, username, pas, query=query, tz=tz, force_sync_request=force_sync_request) saved = [] if 'geojson' in formats: data = tsvToGeoJSON(tmpfile) fname = ofile + ".geojson" with open(fname, "w") as f: f.write(geojson.dumps(data)) saved.append(fname) if 'shape' in formats: tsvToShape(tmpfile, ofile) saved.append(ofile)
host = base["d"] username = base["u"] pas = base["p"] tz = base.get("z") except Exception as e: print __doc__ print "---- error:" print str(e) sys.exit() # pprint.pprint(base) # pprint.pprint(query) tmpfile = getRawData("https://" + host, username, pas, query=query, tz=tz) saved = [] if "geojson" in formats: data = tsvToGeoJSON(tmpfile) fname = ofile + ".geojson" with open(fname, "w") as f: f.write(geojson.dumps(data)) saved.append(fname) if "shape" in formats: tsvToShape(tmpfile, ofile) saved.append(ofile) if "tsv" in formats: fname = ofile + ".tsv"