

def GMLpoints(ring):
    'Extract points from a <gml:LinearRing>.'
    listPoints = []
    if (len(ring.findall(('.//{%s}posList' % ns_gml))) > 0):
        points = ring.findall(('.//{%s}posList' % ns_gml))[0].text
        coords = points.split()
        assert ((len(coords) % 3) == 0)
        for i in range(0, len(coords), 3):
            listPoints.append([float(coords[i]), float(coords[(i + 1)]), float(coords[(i + 2)])])
    elif (len(ring.findall(('.//{%s}pos' % ns_gml))) > 0):
        points = ring.findall(('.//{%s}pos' % ns_gml))
        for p in points:
            coords = p.text.split()
            assert ((len(coords) % 3) == 0)
            for i in range(0, len(coords), 3):
                listPoints.append([float(coords[i]), float(coords[(i + 1)]), float(coords[(i + 2)])])
    else:
        return None
    return listPoints

dataset/ETHPy150Open tudelft3d/CityGML2OBJs/markup3dmodule.py GMLpoints/original