0
.is_empty 매끈한 명령으로 오류가 발생하는빈 다각형 내가 OpenTripPlanner으로 생성 된 아이소 다각형을
다각형은 다음 지시 매끈한 객체로 번역된다{"type":"FeatureCollection","features":[{"type":"Feature","geometry":{"type":"MultiPolygon","coordinates":[]},"properties":{"time":-47},"id":"fid--576b228b_15b66d32d71_-7cbd"}]}
:
isochrone = shapely.geometry.asShape(isochroneJSON['features'][0]['geometry'])
{u'type': u'FeatureCollection', u'features': [{u'geometry': {u'type': u'MultiPolygon', u'coordinates': []}, u'type': u'Feature', u'properties': {u'time': -47}, u'id': u'fid--576b228b_15b66d32d71_-7a54'}]}
I :
이것은 스파이더처럼 모습입니다 정말 빈 다각형처럼 보입니다. 문제는 나머지 치료에서 제외하고 유효하고 비어 있는지 확인하기 위해서입니다. 그리고 다음과 같은 명령 :
return (self._geom is None) or bool(self.impl['is_empty'](self))
self.__geom__, n = self.factory(self.context)
그리고 the only similar question 내 자신의 문제가 발생하지 것 때문에 나는 완전히 손실입니다 :
if not isochrone.is_empty:
는 .is_empty 매끈한 명령으로 오류를 생성합니다.
제 경우에는 'asShape'대신 'shape'를 사용하면 오류가 제거되었습니다. 그러나 나에게 묻지 마라!! –