Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
D
django
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
django
Commits
5ce660cd
Kaydet (Commit)
5ce660cd
authored
Haz 10, 2016
tarafından
Sergey Fedoseev
Kaydeden (comit)
Tim Graham
Haz 21, 2016
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Fixed #25940 -- Added OGRGeometry.from_gml() and GEOSGeometry.from_gml().
üst
20d1cb33
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
44 additions
and
1 deletion
+44
-1
geometries.py
django/contrib/gis/gdal/geometries.py
+5
-0
geom.py
django/contrib/gis/gdal/prototypes/geom.py
+1
-0
geometry.py
django/contrib/gis/geos/geometry.py
+4
-0
gdal.txt
docs/ref/contrib/gis/gdal.txt
+6
-0
geos.txt
docs/ref/contrib/gis/geos.txt
+6
-0
1.11.txt
docs/releases/1.11.txt
+2
-1
test_geom.py
tests/gis_tests/gdal_tests/test_geom.py
+10
-0
test_geos.py
tests/gis_tests/geos_tests/test_geos.py
+10
-0
No files found.
django/contrib/gis/gdal/geometries.py
Dosyayı görüntüle @
5ce660cd
...
...
@@ -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
):
...
...
django/contrib/gis/gdal/prototypes/geom.py
Dosyayı görüntüle @
5ce660cd
...
...
@@ -44,6 +44,7 @@ getz = pnt_func(lgdal.OGR_G_GetZ)
# Geometry creation routines.
from_wkb
=
geom_output
(
lgdal
.
OGR_G_CreateFromWkb
,
[
c_char_p
,
c_void_p
,
POINTER
(
c_void_p
),
c_int
],
offset
=-
2
)
from_wkt
=
geom_output
(
lgdal
.
OGR_G_CreateFromWkt
,
[
POINTER
(
c_char_p
),
c_void_p
,
POINTER
(
c_void_p
)],
offset
=-
1
)
from_gml
=
geom_output
(
lgdal
.
OGR_G_CreateFromGML
,
[
c_char_p
])
create_geom
=
geom_output
(
lgdal
.
OGR_G_CreateGeometry
,
[
c_int
])
clone_geom
=
geom_output
(
lgdal
.
OGR_G_Clone
,
[
c_void_p
])
get_geom_ref
=
geom_output
(
lgdal
.
OGR_G_GetGeometryRef
,
[
c_void_p
,
c_int
])
...
...
django/contrib/gis/geos/geometry.py
Dosyayı görüntüle @
5ce660cd
...
...
@@ -166,6 +166,10 @@ class GEOSGeometry(GEOSBase, ListMixin):
self
.
ptr
=
ptr
self
.
_post_init
(
srid
)
@classmethod
def
from_gml
(
cls
,
gml_string
):
return
gdal
.
OGRGeometry
.
from_gml
(
gml_string
)
.
geos
# Comparison operators
def
__eq__
(
self
,
other
):
"""
...
...
docs/ref/contrib/gis/gdal.txt
Dosyayı görüntüle @
5ce660cd
...
...
@@ -448,6 +448,12 @@ coordinate transformation::
__ http://www.gdal.org/classOGRGeometry.html
.. classmethod:: from_gml(gml_string)
.. versionadded:: 1.11
Constructs an :class:`OGRGeometry` from the given GML string.
.. classmethod:: from_bbox(bbox)
Constructs a :class:`Polygon` from the given bounding-box (a 4-tuple).
...
...
docs/ref/contrib/gis/geos.txt
Dosyayı görüntüle @
5ce660cd
...
...
@@ -198,6 +198,12 @@ WKB / EWKB ``buffer``
GeoJSON ``str`` or ``unicode``
======================= ======================
.. classmethod:: GEOSGeometry.from_gml(gml_string)
.. versionadded:: 1.11
Constructs a :class:`GEOSGeometry` from the given GML string.
Properties
~~~~~~~~~~
...
...
docs/releases/1.11.txt
Dosyayı görüntüle @
5ce660cd
...
...
@@ -74,7 +74,8 @@ Minor features
:mod:`django.contrib.gis`
~~~~~~~~~~~~~~~~~~~~~~~~~
* ...
* The new :meth:`.GEOSGeometry.from_gml` and :meth:`.OGRGeometry.from_gml`
methods allow creating geometries from GML.
:mod:`django.contrib.messages`
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
...
...
tests/gis_tests/gdal_tests/test_geom.py
Dosyayı görüntüle @
5ce660cd
...
...
@@ -543,3 +543,13 @@ class OGRGeomTest(unittest.TestCase, TestDataMixin):
OGRGeometry
(
'POINT(0.5 0.5)'
)
.
within
(
OGRGeometry
(
'POLYGON ((0 0, 0 1, 1 1, 1 0, 0 0))'
)),
True
)
self
.
assertIs
(
OGRGeometry
(
'POINT(0 0)'
)
.
within
(
OGRGeometry
(
'POINT(0 1)'
)),
False
)
def
test_from_gml
(
self
):
self
.
assertEqual
(
OGRGeometry
(
'POINT(0 0)'
),
OGRGeometry
.
from_gml
(
'<gml:Point gml:id="p21" srsName="http://www.opengis.net/def/crs/EPSG/0/4326">'
' <gml:pos srsDimension="2">0 0</gml:pos>'
'</gml:Point>'
),
)
tests/gis_tests/geos_tests/test_geos.py
Dosyayı görüntüle @
5ce660cd
...
...
@@ -1300,6 +1300,16 @@ class GEOSTest(SimpleTestCase, TestDataMixin):
self
.
assertEqual
(
m
.
group
(
'version'
),
v_geos
)
self
.
assertEqual
(
m
.
group
(
'capi_version'
),
v_capi
)
def
test_from_gml
(
self
):
self
.
assertEqual
(
GEOSGeometry
(
'POINT(0 0)'
),
GEOSGeometry
.
from_gml
(
'<gml:Point gml:id="p21" srsName="http://www.opengis.net/def/crs/EPSG/0/4326">'
' <gml:pos srsDimension="2">0 0</gml:pos>'
'</gml:Point>'
),
)
@ignore_warnings
(
category
=
RemovedInDjango20Warning
)
def
test_deprecated_srid_getters_setters
(
self
):
p
=
Point
(
1
,
2
,
srid
=
123
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment