Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我是使用 geodjango 的新手,我需要检查一个点是否存在于多面图层中。试用我用
x = '640744.97964' y = '2498614.18957' p = Point(float(x), float(y), srid=32645) pt=layer.objects.get(the_geom__contains=p)
但我得到错误NoneType对象没有属性'group'
NoneType
'group'
使用 filter 而不是 get,因为您不确定这是否会返回 0、1 或 N 层。
layer.objects.filter(the_geom__contains=p)