Exemplo n.º 1
0


	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"
Exemplo n.º 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)
Exemplo n.º 3
0
        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"