gis.geos.fromstr()

fromstr(string, srid=None)

Parameters:
  • string (string) – string that contains spatial data
  • srid (int) – spatial reference identifier
Return type:

a GEOSGeometry corresponding to the spatial data in the string

fromstr(string, srid) is equivalent to GEOSGeometry(string, srid).

Example:

1
2
>>> from django.contrib.gis.geos import fromstr
>>> pnt = fromstr('POINT(-90.5 29.5)', srid=4326)
doc_Django
2025-01-10 15:47:30
Comments
Leave a Comment

Please login to continue.