Exemplo n.º 1
0
def test_ST_CurveToLine():
    data = ["CURVEPOLYGON(CIRCULARSTRING(0 0, 4 0, 4 4, 0 4, 0 0))"]
    data = pandas.Series(data)
    rst = arctern.ST_AsText(
        arctern.ST_CurveToLine(arctern.ST_GeomFromText(data)))

    assert str(rst[0]).startswith("POLYGON")
Exemplo n.º 2
0
def test_ST_CurveToLine():
    geo = "POLYGON ((0 0,0 1,1 1,1 0,0 0))"
    arr = [geo for x in range(1, 10000001)]
    data = pandas.Series(arr)
    rst = arctern.ST_AsText(
        arctern.ST_CurveToLine(arctern.ST_GeomFromText(data)))
    assert len(rst) == 10000000
Exemplo n.º 3
0
def test_plot8():
    raw_data = []
    raw_data.append('point(0 0)')
    raw_data.append('linestring(0 10, 5 5, 10 0)')
    raw_data.append('polygon((2 2,2 3,3 3,3 2,2 2))')
    raw_data.append("GEOMETRYCOLLECTION(" \
                    "polygon((1 1,1 2,2 2,2 1,1 1))," \
                    "linestring(0 1, 5 6, 10 11)," \
                    "POINT(4 7))")

    arr_wkt = pandas.Series(raw_data)
    arr_wkb = arctern.ST_CurveToLine(arctern.ST_GeomFromText(arr_wkt))

    file_name = "/tmp/test_plot8.png"

    if os.path.exists(file_name):
        os.remove(file_name)

    if os.path.exists(file_name):
        assert False

    fig, ax = plt.subplots()
    arctern.plot.plot_geometry(ax,
                               arr_wkb,
                               color=['orange', 'green'],
                               marker='^',
                               markersize=100,
                               alpha=0.6,
                               linewidth=[None, 7, 8],
                               linestyle=[None, 'dashed', 'dashdot'],
                               edgecolor=[None, None, 'red'],
                               facecolor=[None, None, 'black'])
    ax.grid()
    fig.savefig(file_name)
    file_size = os.path.getsize(file_name)
    file_size = file_size / 1024
    # print(file_size)
    assert 20 <= file_size <= 30
Exemplo n.º 4
0
def test_plot5():
    raw_data = []
    raw_data.append('circularstring(-2 -2, 2 2, -2 -2)')
    raw_data.append('circularstring(-1 -1, 1 1, -1 -1)')

    arr_wkt = pandas.Series(raw_data)
    arr_wkb = arctern.ST_CurveToLine(arctern.ST_GeomFromText(arr_wkt))

    file_name = "/tmp/test_plot5.png"

    if os.path.exists(file_name):
        os.remove(file_name)

    if os.path.exists(file_name):
        assert False

    fig, ax = plt.subplots()
    arctern.plot.plot_geometry(ax, arr_wkb)
    ax.grid()
    fig.savefig(file_name)
    file_size = os.path.getsize(file_name)
    file_size = file_size / 1024
    assert 25 <= file_size <= 35
Exemplo n.º 5
0
def ST_CurveToLine(geos):
    return arctern.ST_CurveToLine(geos)
Exemplo n.º 6
0
def test_ST_CurveToLine():
    data = ["CURVEPOLYGON(CIRCULARSTRING(0 0, 4 0, 4 4, 0 4, 0 0))"]
    array = pyarrow.array(pandas.Series(data))
    rst = arctern.ST_CurveToLine(array)

    assert str(rst[0]).startswith("POLYGON")
Exemplo n.º 7
0
def python_test(data):
    TIME_START(func_name)
    arctern.ST_AsText(arctern.ST_CurveToLine(arctern.ST_GeomFromText(data)))
    TIME_END(func_name)
    return TIME_INFO()