Open SlytherinGe opened 10 months ago
I just found that we can't get the geometry of some relations, say relation(116278).
As in element.py, the code for getting the geometry of a relation is as follows:
elif self.type() == 'relation': membersOuter = self.__geometry_extract(self.members(onlyOuter=True)) if len(membersOuter) == 0: self._raiseException('Cannot build geometry: no outer rings found.') membersInner = self.__geometry_extract(self.members(onlyInner=True)) ringsOuter = self.__geometry_buildRings(membersOuter) ringsInner = self.__geometry_buildRings(membersInner) ringsOuter = self.__geometry_orientRings(ringsOuter, positive=True) ringsInner = self.__geometry_orientRings(ringsInner, positive=False) polygons = self.__geometry_buildPolygons(ringsOuter, ringsInner) if len(polygons) > 1: return geojson.MultiPolygon(polygons) else: return geojson.Polygon(polygons[0])
But some geometries of relations, like routes, are also very important. How can I get the geometry for these none-polygon relations?
As a workaround, you can get the geometries of a route's members and then combine them.
I just found that we can't get the geometry of some relations, say relation(116278).
As in element.py, the code for getting the geometry of a relation is as follows:
But some geometries of relations, like routes, are also very important. How can I get the geometry for these none-polygon relations?