我正在尝试创建两个数组的单个 LineString 对象。我已经尝试了多种方法,但我不断得到:
>>> array = [(0,0),(1,0),(2,0),(3,0)][(1,3),(1.4,2),(2,0)]
TypeError: list indices must be integers, not tuple
## A
## \
## \
## X
## \
## \
## B-----C-----D-----F
## Test to Identify Junctions - Shared points where two or more lines intersect
def test_find_junctions(self):
g = PreserveTopology()
# LINE BCDF, AXD
array = [(0,0),(1,0),(2,0),(3,0)][(1,3),(1.4,2),(2,0)]
# LINE AXD
#array2 = [(1,3),(1.4,2),(2,0)]
array_as_linestring = LineString(array)
#array2_as_linestring = LineString(array2)
result = g.find_junctions_line(array_as_linestring)
assert_equal(result,(2,0))