mirror of
https://github.com/django/django.git
synced 2025-11-23 12:26:57 +00:00
Fixed #25940 -- Added OGRGeometry.from_gml() and GEOSGeometry.from_gml().
This commit is contained in:
parent
20d1cb33c2
commit
5ce660cd65
8 changed files with 44 additions and 1 deletions
|
|
@ -52,6 +52,7 @@ from django.contrib.gis.gdal.prototypes import geom as capi, srs as srs_api
|
|||
from django.contrib.gis.gdal.srs import CoordTransform, SpatialReference
|
||||
from django.contrib.gis.geometry.regex import hex_regex, json_regex, wkt_regex
|
||||
from django.utils import six
|
||||
from django.utils.encoding import force_bytes
|
||||
from django.utils.six.moves import range
|
||||
|
||||
|
||||
|
|
@ -150,6 +151,10 @@ class OGRGeometry(GDALBase):
|
|||
return OGRGeometry('POLYGON((%s %s, %s %s, %s %s, %s %s, %s %s))' % (
|
||||
x0, y0, x0, y1, x1, y1, x1, y0, x0, y0))
|
||||
|
||||
@classmethod
|
||||
def from_gml(cls, gml_string):
|
||||
return cls(capi.from_gml(force_bytes(gml_string)))
|
||||
|
||||
# ### Geometry set-like operations ###
|
||||
# g = g1 | g2
|
||||
def __or__(self, other):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue