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
a8ad1e32
Kaydet (Commit)
a8ad1e32
authored
Eyl 06, 2017
tarafından
Sergey Fedoseev
Kaydeden (comit)
Tim Graham
Eyl 06, 2017
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Replaced get_pointer_arr() with usage of GEOM_PTR for simplicity.
üst
ad4a8acd
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
18 deletions
+7
-18
collections.py
django/contrib/gis/geos/collections.py
+4
-5
libgeos.py
django/contrib/gis/geos/libgeos.py
+0
-8
polygon.py
django/contrib/gis/geos/polygon.py
+3
-5
No files found.
django/contrib/gis/geos/collections.py
Dosyayı görüntüle @
a8ad1e32
...
...
@@ -7,7 +7,7 @@ from ctypes import byref, c_int, c_uint
from
django.contrib.gis.geos
import
prototypes
as
capi
from
django.contrib.gis.geos.error
import
GEOSException
from
django.contrib.gis.geos.geometry
import
GEOSGeometry
,
LinearGeometryMixin
from
django.contrib.gis.geos.libgeos
import
geos_version_tuple
,
get_pointer_arr
from
django.contrib.gis.geos.libgeos
import
GEOM_PTR
,
geos_version_tuple
from
django.contrib.gis.geos.linestring
import
LinearRing
,
LineString
from
django.contrib.gis.geos.point
import
Point
from
django.contrib.gis.geos.polygon
import
Polygon
...
...
@@ -49,12 +49,11 @@ class GeometryCollection(GEOSGeometry):
# ### Methods for compatibility with ListMixin ###
def
_create_collection
(
self
,
length
,
items
):
# Creating the geometry pointer array.
geoms
=
get_pointer_arr
(
length
)
for
i
,
g
in
enumerate
(
items
):
geoms
=
(
GEOM_PTR
*
length
)(
*
[
# this is a little sloppy, but makes life easier
# allow GEOSGeometry types (python wrappers) or pointer types
geoms
[
i
]
=
capi
.
geom_clone
(
getattr
(
g
,
'ptr'
,
g
))
capi
.
geom_clone
(
getattr
(
g
,
'ptr'
,
g
))
for
g
in
items
])
return
capi
.
create_collection
(
c_int
(
self
.
_typeid
),
byref
(
geoms
),
c_uint
(
length
))
def
_get_single_internal
(
self
,
index
):
...
...
django/contrib/gis/geos/libgeos.py
Dosyayı görüntüle @
a8ad1e32
...
...
@@ -127,14 +127,6 @@ CS_PTR = POINTER(GEOSCoordSeq_t)
CONTEXT_PTR
=
POINTER
(
GEOSContextHandle_t
)
# Used specifically by the GEOSGeom_createPolygon and GEOSGeom_createCollection
# GEOS routines
def
get_pointer_arr
(
n
):
"Get a ctypes pointer array (of length `n`) for GEOSGeom_t opaque pointer."
GeomArr
=
GEOM_PTR
*
n
return
GeomArr
()
lgeos
=
SimpleLazyObject
(
load_geos
)
...
...
django/contrib/gis/geos/polygon.py
Dosyayı görüntüle @
a8ad1e32
...
...
@@ -2,7 +2,7 @@ from ctypes import byref, c_uint
from
django.contrib.gis.geos
import
prototypes
as
capi
from
django.contrib.gis.geos.geometry
import
GEOSGeometry
from
django.contrib.gis.geos.libgeos
import
GEOM_PTR
,
get_pointer_arr
from
django.contrib.gis.geos.libgeos
import
GEOM_PTR
from
django.contrib.gis.geos.linestring
import
LinearRing
...
...
@@ -86,10 +86,8 @@ class Polygon(GEOSGeometry):
n_holes
=
length
-
1
if
n_holes
:
holes
=
get_pointer_arr
(
n_holes
)
for
i
,
r
in
enumerate
(
rings
):
holes
[
i
]
=
self
.
_clone
(
r
)
holes_param
=
byref
(
holes
)
holes
=
(
GEOM_PTR
*
n_holes
)(
*
[
self
.
_clone
(
r
)
for
r
in
rings
])
holes_param
=
byref
(
holes
)
else
:
holes_param
=
None
...
...
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