Exemplo n.º 1
0
def test_ST_Overlaps():
    data1 = pandas.Series(
        ["POLYGON ((1 1,1 2,2 2,2 1,1 1))", "POLYGON ((1 1,1 2,2 2,2 1,1 1))"])
    data2 = pandas.Series(
        ["POLYGON ((1 1,1 2,2 2,2 1,1 1))", "POLYGON ((2 1,3 1,3 2,2 2,2 1))"])
    rst = arctern.ST_Overlaps(arctern.ST_GeomFromText(data1),
                              arctern.ST_GeomFromText(data2))
    assert len(rst) == 2
    assert rst[0] == 0
    assert rst[1] == 0

    rst = arctern.ST_Overlaps(
        arctern.ST_GeomFromText(data2),
        arctern.ST_GeomFromText("POLYGON ((1 1,1 2,2 2,2 1,1 1))")[0])
    assert len(rst) == 2
    assert rst[0] == 0
    assert rst[1] == 0

    rst = arctern.ST_Overlaps(
        arctern.ST_GeomFromText("POLYGON ((1 1,1 2,2 2,2 1,1 1))")[0],
        arctern.ST_GeomFromText(data2))
    assert len(rst) == 2
    assert rst[0] == 0
    assert rst[1] == 0

    rst = arctern.ST_Overlaps(
        arctern.ST_GeomFromText("POLYGON ((1 1,1 2,2 2,2 1,1 1))")[0],
        arctern.ST_GeomFromText("POLYGON ((1 1,1 2,2 2,2 1,1 1))")[0])
    assert len(rst) == 1
    assert rst[0] == 0
Exemplo n.º 2
0
def test_ST_Overlaps():
    data1 = pandas.Series(
        ["POLYGON ((1 1,1 2,2 2,2 1,1 1))", "POLYGON ((1 1,1 2,2 2,2 1,1 1))"])
    data2 = pandas.Series(
        ["POLYGON ((1 1,1 2,2 2,2 1,1 1))", "POLYGON ((2 1,3 1,3 2,2 2,2 1))"])
    rst = arctern.ST_Overlaps(data1, data2)
    assert rst[0] == 0
    assert rst[1] == 0
Exemplo n.º 3
0
def test_ST_Overlaps():
    geo1 = "POLYGON ((0 0,0 1,1 1,1 0,0 0))"
    geo2 = "POLYGON ((0 0,0 2,2 2,2 0,0 0))"
    arr1 = [geo1 for x in range(1, 10000001)]
    arr2 = [geo2 for x in range(1, 10000001)]

    data1 = pandas.Series(arr1)
    data2 = pandas.Series(arr2)
    rst = arctern.ST_Overlaps(arctern.ST_GeomFromText(data1),
                              arctern.ST_GeomFromText(data2))
    assert len(rst) == 10000000
Exemplo n.º 4
0
def ST_Overlaps():
    geo1 = "POLYGON ((113.66220266388723 22.39277623851494, 114.58136061218778 22.39277623851494, 114.58136061218778 22.92800492531275 ,113.66220266388723 22.92800492531275, 113.66220266388723 22.39277623851494))"
    geo2 = "POINT (1 1)"
    geo_wkb1 = arctern.ST_GeomFromText(geo1)[0]
    geo_wkb2 = arctern.ST_GeomFromText(geo2)[0]
    arr1 = [geo_wkb1 for x in range(1, 40000001)]
    arr2 = [geo_wkb2 for x in range(1, 40000001)]

    data1 = pandas.Series(arr1)
    data2 = pandas.Series(arr2)
    rst = arctern.ST_Overlaps(data1, data2)
    assert len(rst) == 40000000
Exemplo n.º 5
0
def python_test(data1, data2):
    TIME_START(func_name)
    arctern.ST_Overlaps(arctern.ST_GeomFromText(data1), arctern.ST_GeomFromText(data2))
    TIME_END(func_name)

    return TIME_INFO()
Exemplo n.º 6
0
def ST_Overlaps(left, right):
    return arctern.ST_Overlaps(left, right)