Beispiel #1
0
def test_ST_Envelope():
    p1 = "point (10 10)"
    p2 = "linestring (0 0 , 0 10)"
    p3 = "linestring (0 0 , 10 0)"
    p4 = "linestring (0 0 , 10 10)"
    p5 = "polygon ((0 0, 10 0, 10 10, 0 10, 0 0))"
    p6 = "multipoint (0 0, 10 0, 5 5)"
    p7 = "multilinestring ((0 0, 5 5), (6 6, 6 7, 10 10))"
    p8 = "multipolygon (((0 0, 10 0, 10 10, 0 10, 0 0), (11 11, 20 11, 20 20, 20 11, 11 11)))"
    data = [p1, p2, p3, p4, p5, p6, p7, p8]
    data = pandas.Series(data)
    rst = arctern.ST_AsText(arctern.ST_Envelope(arctern.ST_GeomFromText(data)))

    assert rst[0] == "POINT (10 10)"
    assert rst[1] == "LINESTRING (0 0,0 10)"
    assert rst[2] == "LINESTRING (0 0,10 0)"
    assert rst[3] == "POLYGON ((0 0,0 10,10 10,10 0,0 0))"
    assert rst[4] == "POLYGON ((0 0,0 10,10 10,10 0,0 0))"
    assert rst[5] == "POLYGON ((0 0,0 5,10 5,10 0,0 0))"
    assert rst[6] == "POLYGON ((0 0,0 10,10 10,10 0,0 0))"
    assert rst[7] == "POLYGON ((0 0,0 20,20 20,20 0,0 0))"
Beispiel #2
0
def ST_Envelope(geos):
    return arctern.ST_Envelope(geos)
Beispiel #3
0
def test_ST_Envelope():
    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_Envelope(arctern.ST_GeomFromText(data)))
    assert len(rst) == 10000000
Beispiel #4
0
def python_test(data):
    TIME_START(func_name)
    arctern.ST_AsText(arctern.ST_Envelope(arctern.ST_GeomFromText(data)))
    TIME_END(func_name)

    return TIME_INFO()