示例#1
0
def test_projection():
    wkt = ["POINT (-8235193.62386326 4976211.44428777)"]
    top_left = "POINT (-8235871.4482427 4976468.32320551)"
    bottom_right = "POINT (-8235147.42627458 4976108.43009739)"

    arr_wkb = pandas.Series(arctern.wkt2wkb(wkt))
    arctern.projection(arr_wkb, bottom_right, top_left, 200, 300)
示例#2
0
def test_choropleth_map():
    wkt_data = []
    count_data = []

    wkt_data.append("POLYGON (("
                    "200 200, "
                    "200 300, "
                    "300 300, "
                    "300 200, "
                    "200 200))")
    count_data.append(5.0)

    arr_wkt = pandas.Series(wkt_data)
    arr_wkb = arctern.wkt2wkb(arr_wkt)
    arr_count = pandas.Series(count_data)

    vega = vega_choroplethmap(
        1900,
        1410,
        bounding_box=[-73.994092, 40.753893, -73.977588, 40.759642],
        color_gradient=["#0000FF", "#FF0000"],
        color_bound=[2.5, 5],
        opacity=1.0,
        coordinate_system='EPSG:4326')
    choropleth_map1 = arctern.choropleth_map(vega, arr_wkb, arr_count)
    save_png(choropleth_map1, "/tmp/test_choropleth_map1.png")
示例#3
0
def test_choropleth_map():
    wkt_data = []
    count_data = []

    wkt_data.append("POLYGON (("
                    "-73.97324 40.73747, "
                    "-73.96524 40.74507, "
                    "-73.96118 40.75890, "
                    "-73.95556 40.77654, "
                    "-73.97324 40.73747))")
    count_data.append(5.0)

    arr_wkt = pandas.Series(wkt_data)
    arr_wkb = arctern.wkt2wkb(arr_wkt)
    arr_count = pandas.Series(count_data)

    vega = vega_choroplethmap(
        1024,
        896,
        bounding_box=[-73.998427, 40.730309, -73.954348, 40.780816],
        color_gradient=["#0000FF", "#FF0000"],
        color_bound=[2.5, 5],
        opacity=1.0,
        coordinate_system='EPSG:4326')
    choropleth_map1 = arctern.choropleth_map_layer(vega, arr_wkb, arr_count)
    save_png(choropleth_map1, "/tmp/test_choropleth_map1.png")
def test_choroplethmap():
    wkt_data = []
    count_data = []

    wkt_data.append("POLYGON (("
                    "-73.97324 40.73747, "
                    "-73.96524 40.74507, "
                    "-73.96118 40.75890, "
                    "-73.95556 40.77654, "
                    "-73.97324 40.73747))")
    count_data.append(5.0)

    arr_wkt = pandas.Series(wkt_data)
    arr_wkb = arctern.wkt2wkb(arr_wkt)
    arr_count = pandas.Series(count_data)

    ax = _get_matplot()
    ap.plot_choroplethmap(ax,
                          arr_wkb,
                          arr_count,
                          bounding_box=bounding_box,
                          color_gradient=["#0000FF", "#FF0000"],
                          color_bound=[2.5, 5],
                          opacity=1.0,
                          coordinate_system='EPSG:4326')
    _finalize(ax, "test_choropleth_map1")
示例#5
0
def test_transfrom_and_projection():
    wkt = ["POINT (-73.978003 40.754594)"]
    top_left = "POINT (-73.984092 40.756342)"
    bottom_right = "POINT (-73.977588 40.753893)"
    src_ts = "EPSG:4326"
    dst_rs = "EPSG:3857"

    arr_wkb = pandas.Series(arctern.wkt2wkb(wkt))
    arctern.transform_and_projection(arr_wkb, src_ts, dst_rs, bottom_right, top_left, 200, 300)
示例#6
0
def test_choropleth_map():
    wkt_data = []
    count_data = []

    wkt_data.append("POLYGON (("
      "200 200, "
      "200 300, "
      "300 300, "
      "300 200, "
      "200 200))")
    count_data.append(5.0)

    arr_wkt = pandas.Series(wkt_data)
    arr_wkb = arctern.wkt2wkb(arr_wkt)
    arr_count = pandas.Series(count_data)

    vega = vega_choroplethmap(1900, 1410, [-73.994092, 40.753893, -73.977588, 40.759642], ["#0000FF", "#FF0000"], [2.5, 5], 1.0, 'EPSG:4326')
    choropleth_map1 = arctern.choropleth_map(vega, arr_wkb, arr_count)
    save_png(choropleth_map1, "/tmp/test_choropleth_map1.png")
示例#7
0
def test_choropleth_map():
    wkt_data = []
    count_data = []

    wkt_data.append("POLYGON (("
                    "200 200, "
                    "200 300, "
                    "300 300, "
                    "300 200, "
                    "200 200))")
    count_data.append(5.0)

    arr_wkt = pandas.Series(wkt_data)
    arr_count = pandas.Series(count_data)

    vega_choropleth_map = vega_choroplethmap(
        1900, 1410, [-73.994092, 40.753893, -73.977588, 40.759642],
        "blue_to_red", [2.5, 5], 1.0, 'EPSG:4326')
    vega_json = vega_choropleth_map.build()

    arr_wkb = arctern.wkt2wkb(arr_wkt)
    choropleth_map1 = arctern.choropleth_map(arr_wkb, arr_count,
                                             vega_json.encode('utf-8'))
    save_png(choropleth_map1, "/tmp/test_choropleth_map1.png")
示例#8
0
def WktToWkb(wkts):
    return arctern.wkt2wkb(wkts)