0

I am newbie in using geodjango, I need to check whether a point is present in a multipolygon layer. For trial I used

x = '640744.97964'
y = '2498614.18957'
p = Point(float(x), float(y), srid=32645)
pt=layer.objects.get(the_geom__contains=p)

but I got the error NoneType object has no attribute 'group'

jamylak
  • 128,818
  • 30
  • 231
  • 230
Anju
  • 137
  • 2
  • 10

1 Answers1

0

Use filter instead of get, since you are not sure whether this will return 0, 1 or N layers.

layer.objects.filter(the_geom__contains=p)
RickyA
  • 15,465
  • 5
  • 71
  • 95