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
8a92139d
Kaydet (Commit)
8a92139d
authored
Mar 08, 2013
tarafından
Claude Paroz
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Replaced proj4 testing by a regex
üst
cbfb8ed5
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
7 deletions
+8
-7
test_spatialrefsys.py
django/contrib/gis/tests/test_spatialrefsys.py
+8
-7
No files found.
django/contrib/gis/tests/test_spatialrefsys.py
Dosyayı görüntüle @
8a92139d
...
...
@@ -2,6 +2,7 @@ from django.db import connection
from
django.contrib.gis.gdal
import
HAS_GDAL
from
django.contrib.gis.tests.utils
import
(
no_mysql
,
oracle
,
postgis
,
spatialite
,
HAS_SPATIALREFSYS
,
SpatialRefSys
)
from
django.utils
import
six
from
django.utils
import
unittest
...
...
@@ -10,9 +11,8 @@ test_srs = ({'srid' : 4326,
'auth_srid'
:
4326
,
# Only the beginning, because there are differences depending on installed libs
'srtext'
:
'GEOGCS["WGS 84",DATUM["WGS_1984",SPHEROID["WGS 84"'
,
'proj4'
:
[
'+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs '
,
# +ellps=WGS84 has been removed in the 4326 proj string in proj-4.8
'+proj=longlat +datum=WGS84 +no_defs '
],
# +ellps=WGS84 has been removed in the 4326 proj string in proj-4.8
'proj4_re'
:
r'\+proj=longlat (\+ellps=WGS84 )?\+datum=WGS84 \+no_defs '
,
'spheroid'
:
'WGS 84'
,
'name'
:
'WGS 84'
,
'geographic'
:
True
,
'projected'
:
False
,
'spatialite'
:
True
,
'ellipsoid'
:
(
6378137.0
,
6356752.3
,
298.257223563
),
# From proj's "cs2cs -le" and Wikipedia (semi-minor only)
...
...
@@ -22,8 +22,9 @@ test_srs = ({'srid' : 4326,
'auth_name'
:
(
'EPSG'
,
False
),
'auth_srid'
:
32140
,
'srtext'
:
'PROJCS["NAD83 / Texas South Central",GEOGCS["NAD83",DATUM["North_American_Datum_1983",SPHEROID["GRS 1980"'
,
'proj4'
:
[
'+proj=lcc +lat_1=30.28333333333333 +lat_2=28.38333333333333 +lat_0=27.83333333333333 +lon_0=-99 +x_0=600000 +y_0=4000000 +ellps=GRS80 +datum=NAD83 +units=m +no_defs '
,
'+proj=lcc +lat_1=30.28333333333333 +lat_2=28.38333333333333 +lat_0=27.83333333333333 +lon_0=-99 +x_0=600000 +y_0=4000000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs '
],
'proj4_re'
:
r'\+proj=lcc \+lat_1=30.28333333333333 \+lat_2=28.38333333333333 \+lat_0=27.83333333333333 '
r'\+lon_0=-99 \+x_0=600000 \+y_0=4000000 \+ellps=GRS80 '
r'(\+datum=NAD83 |\+towgs84=0,0,0,0,0,0,0)?\+units=m \+no_defs '
,
'spheroid'
:
'GRS 1980'
,
'name'
:
'NAD83 / Texas South Central'
,
'geographic'
:
False
,
'projected'
:
True
,
'spatialite'
:
False
,
'ellipsoid'
:
(
6378137.0
,
6356752.31414
,
298.257222101
),
# From proj's "cs2cs -le" and Wikipedia (semi-minor only)
...
...
@@ -54,7 +55,7 @@ class SpatialRefSysTest(unittest.TestCase):
# No proj.4 and different srtext on oracle backends :(
if
postgis
:
self
.
assertTrue
(
srs
.
wkt
.
startswith
(
sd
[
'srtext'
]))
s
elf
.
assertTrue
(
srs
.
proj4text
in
sd
[
'proj4
'
])
s
ix
.
assertRegex
(
self
,
srs
.
proj4text
,
sd
[
'proj4_re
'
])
@no_mysql
def
test02_osr
(
self
):
...
...
@@ -73,7 +74,7 @@ class SpatialRefSysTest(unittest.TestCase):
# Testing the SpatialReference object directly.
if
postgis
or
spatialite
:
srs
=
sr
.
srs
s
elf
.
assertTrue
(
srs
.
proj4
in
sd
[
'proj4
'
])
s
ix
.
assertRegex
(
self
,
srs
.
proj4
,
sd
[
'proj4_re
'
])
# No `srtext` field in the `spatial_ref_sys` table in SpatiaLite
if
not
spatialite
:
self
.
assertTrue
(
srs
.
wkt
.
startswith
(
sd
[
'srtext'
]))
...
...
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