from django.contrib.gis.geos import Point p = Point(0, 0, srid=4326) # creates a point with lat-long coordinates
from django.contrib.gis.geos import Point p = Point(0, 0, srid=4326) # creates a point with lat-long coordinates p.transform(3857) # converts the point to Web Mercator projection (EPSG:3857)
from django.contrib.gis.geos import Point, Polygon p = Point(0, 0, srid=4326) # creates a point with lat-long coordinates poly = Polygon(((0, 0), (0, 1), (1, 1), (1, 0), (0, 0)), srid=4326) # creates a square polygon if poly.contains(p): print("The point is inside the polygon") else: print("The point is outside the polygon")In these examples, the package library used is django.contrib.gis.geos.