def test_ST_Centroid(): data = ["POLYGON((0 0,1 0,1 1,0 1,0 0))", "POLYGON((0 0,0 8,8 8,8 0,0 0))"] data = pandas.Series(data) rst = arctern.ST_AsText(arctern.ST_Centroid(arctern.ST_GeomFromText(data))) assert rst[0] == "POINT (0.5 0.5)" assert rst[1] == "POINT (4 4)"
def test_ST_Centroid(): data = ["POLYGON((0 0,1 0,1 1,0 1,0 0))", "POLYGON((0 0,0 8,8 8,8 0,0 0))"] array = pyarrow.array(pandas.Series(data)) rst = arctern.ST_Centroid(array) assert rst[0] == "POINT (0.5 0.5)" assert rst[1] == "POINT (4 4)"
def ST_Centroid(geos): return arctern.ST_Centroid(geos)
def python_test(data): TIME_START(func_name) arctern.ST_AsText(arctern.ST_Centroid(arctern.ST_GeomFromText(data))) TIME_END(func_name) return TIME_INFO()
def test_ST_Centroid(): 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_Centroid(arctern.ST_GeomFromText(data))) assert len(rst) == 10000000