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
6f23996a
Kaydet (Commit)
6f23996a
authored
Ara 28, 2018
tarafından
Tim Graham
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Refs #28841 -- Removed ForceRHR function per deprecation timeline.
üst
1fecde6b
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
18 additions
and
64 deletions
+18
-64
operations.py
django/contrib/gis/db/backends/base/operations.py
+4
-4
operations.py
django/contrib/gis/db/backends/mysql/operations.py
+3
-3
operations.py
django/contrib/gis/db/backends/oracle/operations.py
+3
-3
operations.py
django/contrib/gis/db/backends/spatialite/operations.py
+1
-1
functions.py
django/contrib/gis/db/models/functions.py
+0
-13
db-api.txt
docs/ref/contrib/gis/db-api.txt
+0
-1
functions.txt
docs/ref/contrib/gis/functions.txt
+5
-21
3.0.txt
docs/releases/3.0.txt
+1
-1
test_functions.py
tests/gis_tests/geoapp/test_functions.py
+1
-17
No files found.
django/contrib/gis/db/backends/base/operations.py
Dosyayı görüntüle @
6f23996a
...
@@ -40,10 +40,10 @@ class BaseSpatialOperations:
...
@@ -40,10 +40,10 @@ class BaseSpatialOperations:
unsupported_functions
=
{
unsupported_functions
=
{
'Area'
,
'AsGeoJSON'
,
'AsGML'
,
'AsKML'
,
'AsSVG'
,
'Azimuth'
,
'Area'
,
'AsGeoJSON'
,
'AsGML'
,
'AsKML'
,
'AsSVG'
,
'Azimuth'
,
'BoundingCircle'
,
'Centroid'
,
'Difference'
,
'Distance'
,
'Envelope'
,
'BoundingCircle'
,
'Centroid'
,
'Difference'
,
'Distance'
,
'Envelope'
,
'
ForceRHR'
,
'GeoHash'
,
'Intersection'
,
'IsValid'
,
'Length
'
,
'
GeoHash'
,
'Intersection'
,
'IsValid'
,
'Length'
,
'LineLocatePoint
'
,
'
LineLocatePoint'
,
'MakeValid'
,
'MemSize'
,
'NumGeometries
'
,
'
MakeValid'
,
'MemSize'
,
'NumGeometries'
,
'NumPoints'
,
'Perimeter
'
,
'
NumPoints'
,
'Perimeter'
,
'PointOnSurface'
,
'Reverse'
,
'Scal
e'
,
'
PointOnSurface'
,
'Reverse'
,
'Scale'
,
'SnapToGrid'
,
'SymDifferenc
e'
,
'
SnapToGrid'
,
'SymDifference'
,
'
Transform'
,
'Translate'
,
'Union'
,
'Transform'
,
'Translate'
,
'Union'
,
}
}
# Constructors
# Constructors
...
...
django/contrib/gis/db/backends/mysql/operations.py
Dosyayı görüntüle @
6f23996a
...
@@ -56,9 +56,9 @@ class MySQLOperations(BaseSpatialOperations, DatabaseOperations):
...
@@ -56,9 +56,9 @@ class MySQLOperations(BaseSpatialOperations, DatabaseOperations):
def
unsupported_functions
(
self
):
def
unsupported_functions
(
self
):
unsupported
=
{
unsupported
=
{
'AsGML'
,
'AsKML'
,
'AsSVG'
,
'Azimuth'
,
'BoundingCircle'
,
'AsGML'
,
'AsKML'
,
'AsSVG'
,
'Azimuth'
,
'BoundingCircle'
,
'ForcePolygonCW'
,
'
ForceRHR'
,
'LineLocatePoint'
,
'MakeValid
'
,
'ForcePolygonCW'
,
'
LineLocatePoint'
,
'MakeValid'
,
'MemSize
'
,
'
MemSize'
,
'Perimeter'
,
'PointOnSurface'
,
'Reverse'
,
'Scale
'
,
'
Perimeter'
,
'PointOnSurface'
,
'Reverse'
,
'Scale'
,
'SnapToGrid
'
,
'
SnapToGrid'
,
'
Transform'
,
'Translate'
,
'Transform'
,
'Translate'
,
}
}
if
self
.
connection
.
mysql_is_mariadb
:
if
self
.
connection
.
mysql_is_mariadb
:
unsupported
.
update
({
'GeoHash'
,
'IsValid'
})
unsupported
.
update
({
'GeoHash'
,
'IsValid'
})
...
...
django/contrib/gis/db/backends/oracle/operations.py
Dosyayı görüntüle @
6f23996a
...
@@ -106,9 +106,9 @@ class OracleOperations(BaseSpatialOperations, DatabaseOperations):
...
@@ -106,9 +106,9 @@ class OracleOperations(BaseSpatialOperations, DatabaseOperations):
}
}
unsupported_functions
=
{
unsupported_functions
=
{
'AsGeoJSON'
,
'AsKML'
,
'AsSVG'
,
'Azimuth'
,
'AsGeoJSON'
,
'AsKML'
,
'AsSVG'
,
'Azimuth'
,
'ForcePolygonCW'
,
'GeoHash'
,
'
ForcePolygonCW'
,
'ForceRHR'
,
'GeoHash'
,
'LineLocatePoint
'
,
'
LineLocatePoint'
,
'MakeValid'
,
'MemSize'
,
'Scale'
,
'SnapToGrid
'
,
'
MakeValid'
,
'MemSize'
,
'Scale'
,
'SnapToGrid'
,
'
Translate'
,
'Translate'
,
}
}
def
geo_quote_name
(
self
,
name
):
def
geo_quote_name
(
self
,
name
):
...
...
django/contrib/gis/db/backends/spatialite/operations.py
Dosyayı görüntüle @
6f23996a
...
@@ -81,7 +81,7 @@ class SpatiaLiteOperations(BaseSpatialOperations, DatabaseOperations):
...
@@ -81,7 +81,7 @@ class SpatiaLiteOperations(BaseSpatialOperations, DatabaseOperations):
@cached_property
@cached_property
def
unsupported_functions
(
self
):
def
unsupported_functions
(
self
):
unsupported
=
{
'BoundingCircle'
,
'
ForceRHR'
,
'
MemSize'
}
unsupported
=
{
'BoundingCircle'
,
'MemSize'
}
if
not
self
.
lwgeom_version
():
if
not
self
.
lwgeom_version
():
unsupported
|=
{
'Azimuth'
,
'GeoHash'
,
'IsValid'
,
'MakeValid'
}
unsupported
|=
{
'Azimuth'
,
'GeoHash'
,
'IsValid'
,
'MakeValid'
}
return
unsupported
return
unsupported
...
...
django/contrib/gis/db/models/functions.py
Dosyayı görüntüle @
6f23996a
import
warnings
from
decimal
import
Decimal
from
decimal
import
Decimal
from
django.contrib.gis.db.models.fields
import
BaseSpatialField
,
GeometryField
from
django.contrib.gis.db.models.fields
import
BaseSpatialField
,
GeometryField
...
@@ -11,7 +10,6 @@ from django.db.models import (
...
@@ -11,7 +10,6 @@ from django.db.models import (
from
django.db.models.expressions
import
Func
,
Value
from
django.db.models.expressions
import
Func
,
Value
from
django.db.models.functions
import
Cast
from
django.db.models.functions
import
Cast
from
django.db.utils
import
NotSupportedError
from
django.db.utils
import
NotSupportedError
from
django.utils.deprecation
import
RemovedInDjango30Warning
from
django.utils.functional
import
cached_property
from
django.utils.functional
import
cached_property
NUMERIC_TYPES
=
(
int
,
float
,
Decimal
)
NUMERIC_TYPES
=
(
int
,
float
,
Decimal
)
...
@@ -284,17 +282,6 @@ class ForcePolygonCW(GeomOutputGeoFunc):
...
@@ -284,17 +282,6 @@ class ForcePolygonCW(GeomOutputGeoFunc):
arity
=
1
arity
=
1
class
ForceRHR
(
GeomOutputGeoFunc
):
arity
=
1
def
__init__
(
self
,
*
args
,
**
kwargs
):
warnings
.
warn
(
'ForceRHR is deprecated in favor of ForcePolygonCW.'
,
RemovedInDjango30Warning
,
stacklevel
=
2
,
)
super
()
.
__init__
(
*
args
,
**
kwargs
)
class
GeoHash
(
GeoFunc
):
class
GeoHash
(
GeoFunc
):
output_field
=
TextField
()
output_field
=
TextField
()
...
...
docs/ref/contrib/gis/db-api.txt
Dosyayı görüntüle @
6f23996a
...
@@ -383,7 +383,6 @@ Function PostGIS Oracle MySQL Spat
...
@@ -383,7 +383,6 @@ Function PostGIS Oracle MySQL Spat
:class:`Distance` X X X X
:class:`Distance` X X X X
:class:`Envelope` X X X X
:class:`Envelope` X X X X
:class:`ForcePolygonCW` X X
:class:`ForcePolygonCW` X X
:class:`ForceRHR` X
:class:`GeoHash` X X (≥ 5.7.5) X (LWGEOM)
:class:`GeoHash` X X (≥ 5.7.5) X (LWGEOM)
:class:`Intersection` X X X X
:class:`Intersection` X X X X
:class:`IsValid` X X X (≥ 5.7.5) X (LWGEOM)
:class:`IsValid` X X X (≥ 5.7.5) X (LWGEOM)
...
...
docs/ref/contrib/gis/functions.txt
Dosyayı görüntüle @
6f23996a
...
@@ -24,12 +24,11 @@ Function's summary:
...
@@ -24,12 +24,11 @@ Function's summary:
Measurement Relationships Operations Editors Output format Miscellaneous
Measurement Relationships Operations Editors Output format Miscellaneous
================== ======================== ====================== ======================= ================== =====================
================== ======================== ====================== ======================= ================== =====================
:class:`Area` :class:`Azimuth` :class:`Difference` :class:`ForcePolygonCW` :class:`AsGeoJSON` :class:`IsValid`
:class:`Area` :class:`Azimuth` :class:`Difference` :class:`ForcePolygonCW` :class:`AsGeoJSON` :class:`IsValid`
:class:`Distance` :class:`BoundingCircle` :class:`Intersection` :class:`ForceRHR` :class:`AsGML` :class:`MemSize`
:class:`Distance` :class:`BoundingCircle` :class:`Intersection` :class:`MakeValid` :class:`AsGML` :class:`MemSize`
:class:`Length` :class:`Centroid` :class:`SymDifference` :class:`MakeValid` :class:`AsKML` :class:`NumGeometries`
:class:`Length` :class:`Centroid` :class:`SymDifference` :class:`Reverse` :class:`AsKML` :class:`NumGeometries`
:class:`Perimeter` :class:`Envelope` :class:`Union` :class:`Reverse` :class:`AsSVG` :class:`NumPoints`
:class:`Perimeter` :class:`Envelope` :class:`Union` :class:`Scale` :class:`AsSVG` :class:`NumPoints`
.. :class:`LineLocatePoint` :class:`Scale` :class:`GeoHash`
.. :class:`LineLocatePoint` :class:`SnapToGrid` :class:`GeoHash`
.. :class:`PointOnSurface` :class:`SnapToGrid`
.. :class:`PointOnSurface` :class:`Transform`
.. :class:`Transform`
.. :class:`Translate`
.. :class:`Translate`
================== ======================== ====================== ======================= ================== =====================
================== ======================== ====================== ======================= ================== =====================
...
@@ -291,21 +290,6 @@ of the polygon/multipolygon in which all exterior rings are oriented clockwise
...
@@ -291,21 +290,6 @@ of the polygon/multipolygon in which all exterior rings are oriented clockwise
and all interior rings are oriented counterclockwise. Non-polygonal geometries
and all interior rings are oriented counterclockwise. Non-polygonal geometries
are returned unchanged.
are returned unchanged.
``ForceRHR``
============
.. class:: ForceRHR(expression, **extra)
.. deprecated:: 2.1
Use :class:`ForcePolygonCW` instead.
*Availability*: `PostGIS <https://postgis.net/docs/ST_ForceRHR.html>`__
Accepts a single geographic field or expression and returns a modified version
of the polygon/multipolygon in which all of the vertices follow the
right-hand rule.
``GeoHash``
``GeoHash``
===========
===========
...
...
docs/releases/3.0.txt
Dosyayı görüntüle @
6f23996a
...
@@ -253,4 +253,4 @@ to remove usage of these features.
...
@@ -253,4 +253,4 @@ to remove usage of these features.
See :ref:`deprecated-features-2.1` for details on these changes, including how
See :ref:`deprecated-features-2.1` for details on these changes, including how
to remove usage of these features.
to remove usage of these features.
*
..
.
*
The ``ForceRHR`` GIS function is removed
.
tests/gis_tests/geoapp/test_functions.py
Dosyayı görüntüle @
6f23996a
...
@@ -10,8 +10,7 @@ from django.contrib.gis.geos import (
...
@@ -10,8 +10,7 @@ from django.contrib.gis.geos import (
from
django.contrib.gis.measure
import
Area
from
django.contrib.gis.measure
import
Area
from
django.db
import
NotSupportedError
,
connection
from
django.db
import
NotSupportedError
,
connection
from
django.db.models
import
Sum
from
django.db.models
import
Sum
from
django.test
import
TestCase
,
ignore_warnings
,
skipUnlessDBFeature
from
django.test
import
TestCase
,
skipUnlessDBFeature
from
django.utils.deprecation
import
RemovedInDjango30Warning
from
..utils
import
FuncTestMixin
,
mysql
,
oracle
,
postgis
,
spatialite
from
..utils
import
FuncTestMixin
,
mysql
,
oracle
,
postgis
,
spatialite
from
.models
import
City
,
Country
,
CountryWebMercator
,
State
,
Track
from
.models
import
City
,
Country
,
CountryWebMercator
,
State
,
Track
...
@@ -230,21 +229,6 @@ class GISFunctionsTests(FuncTestMixin, TestCase):
...
@@ -230,21 +229,6 @@ class GISFunctionsTests(FuncTestMixin, TestCase):
st
=
State
.
objects
.
annotate
(
force_polygon_cw
=
functions
.
ForcePolygonCW
(
'poly'
))
.
get
(
name
=
'Foo'
)
st
=
State
.
objects
.
annotate
(
force_polygon_cw
=
functions
.
ForcePolygonCW
(
'poly'
))
.
get
(
name
=
'Foo'
)
self
.
assertEqual
(
rhr_rings
,
st
.
force_polygon_cw
.
coords
)
self
.
assertEqual
(
rhr_rings
,
st
.
force_polygon_cw
.
coords
)
@skipUnlessDBFeature
(
"has_ForceRHR_function"
)
@ignore_warnings
(
category
=
RemovedInDjango30Warning
)
def
test_force_rhr
(
self
):
rings
=
(
((
0
,
0
),
(
5
,
0
),
(
0
,
5
),
(
0
,
0
)),
((
1
,
1
),
(
1
,
3
),
(
3
,
1
),
(
1
,
1
)),
)
rhr_rings
=
(
((
0
,
0
),
(
0
,
5
),
(
5
,
0
),
(
0
,
0
)),
((
1
,
1
),
(
3
,
1
),
(
1
,
3
),
(
1
,
1
)),
)
State
.
objects
.
create
(
name
=
'Foo'
,
poly
=
Polygon
(
*
rings
))
st
=
State
.
objects
.
annotate
(
force_rhr
=
functions
.
ForceRHR
(
'poly'
))
.
get
(
name
=
'Foo'
)
self
.
assertEqual
(
rhr_rings
,
st
.
force_rhr
.
coords
)
@skipUnlessDBFeature
(
"has_GeoHash_function"
)
@skipUnlessDBFeature
(
"has_GeoHash_function"
)
def
test_geohash
(
self
):
def
test_geohash
(
self
):
# Reference query:
# Reference query:
...
...
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