コード例 #1
0
ファイル: getdata.py プロジェクト: SkydataCR/pegasus


	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"
コード例 #2
0
            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)
コード例 #3
0
ファイル: getdata.py プロジェクト: alfqui19/pegasus
        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"