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
72ff70fb
Kaydet (Commit)
72ff70fb
authored
May 07, 2016
tarafından
Claude Paroz
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Made GDAL proj test less fragile
The WGS84 proj string can differ depending on installed libs. Refs #26592.
üst
dbd99de6
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
12 deletions
+13
-12
test_srs.py
tests/gis_tests/gdal_tests/test_srs.py
+13
-12
No files found.
tests/gis_tests/gdal_tests/test_srs.py
Dosyayı görüntüle @
72ff70fb
...
...
@@ -13,6 +13,8 @@ class TestSRS:
for
key
,
value
in
kwargs
.
items
():
setattr
(
self
,
key
,
value
)
WGS84_proj
=
'+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs '
# Some Spatial Reference examples
srlist
=
(
TestSRS
(
...
...
@@ -20,7 +22,6 @@ srlist = (
'AUTHORITY["EPSG","7030"]],TOWGS84[0,0,0,0,0,0,0],AUTHORITY["EPSG","6326"]],'
'PRIMEM["Greenwich",0,AUTHORITY["EPSG","8901"]],UNIT["degree",'
'0.01745329251994328,AUTHORITY["EPSG","9122"]],AUTHORITY["EPSG","4326"]]'
,
proj
=
'+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs '
,
epsg
=
4326
,
projected
=
False
,
geographic
=
True
,
local
=
False
,
lin_name
=
'unknown'
,
ang_name
=
'degree'
,
lin_units
=
1.0
,
ang_units
=
0.0174532925199
,
auth
=
{
'GEOGCS'
:
(
'EPSG'
,
'4326'
),
'spheroid'
:
(
'EPSG'
,
'7030'
)},
...
...
@@ -38,7 +39,7 @@ srlist = (
'PARAMETER["central_meridian",-99],PARAMETER["false_easting",600000],'
'PARAMETER["false_northing",4000000],UNIT["metre",1,AUTHORITY["EPSG","9001"]],'
'AUTHORITY["EPSG","32140"]]'
,
proj
=
None
,
epsg
=
32140
,
projected
=
True
,
geographic
=
False
,
local
=
False
,
epsg
=
32140
,
projected
=
True
,
geographic
=
False
,
local
=
False
,
lin_name
=
'metre'
,
ang_name
=
'degree'
,
lin_units
=
1.0
,
ang_units
=
0.0174532925199
,
auth
=
{
'PROJCS'
:
(
'EPSG'
,
'32140'
),
'spheroid'
:
(
'EPSG'
,
'7019'
),
'unit'
:
(
'EPSG'
,
'9001'
)},
attr
=
(
...
...
@@ -56,7 +57,7 @@ srlist = (
'PARAMETER["Central_Meridian",-99.0],PARAMETER["Standard_Parallel_1",28.38333333333333],'
'PARAMETER["Standard_Parallel_2",30.28333333333334],PARAMETER["Latitude_Of_Origin",27.83333333333333],'
'UNIT["Foot_US",0.3048006096012192]]'
,
proj
=
None
,
epsg
=
None
,
projected
=
True
,
geographic
=
False
,
local
=
False
,
epsg
=
None
,
projected
=
True
,
geographic
=
False
,
local
=
False
,
lin_name
=
'Foot_US'
,
ang_name
=
'Degree'
,
lin_units
=
0.3048006096012192
,
ang_units
=
0.0174532925199
,
auth
=
{
'PROJCS'
:
(
None
,
None
)},
attr
=
((
'PROJCS|GeOgCs|spheroid'
,
'GRS_1980'
),
((
'projcs'
,
9
),
'UNIT'
),
((
'projcs'
,
11
),
None
),),
...
...
@@ -64,7 +65,7 @@ srlist = (
# This is really ESRI format, not WKT -- but the import should work the same
TestSRS
(
'LOCAL_CS["Non-Earth (Meter)",LOCAL_DATUM["Local Datum",0],UNIT["Meter",1.0],AXIS["X",EAST],AXIS["Y",NORTH]]'
,
esri
=
True
,
proj
=
None
,
epsg
=
None
,
projected
=
False
,
geographic
=
False
,
local
=
True
,
esri
=
True
,
epsg
=
None
,
projected
=
False
,
geographic
=
False
,
local
=
True
,
lin_name
=
'Meter'
,
ang_name
=
'degree'
,
lin_units
=
1.0
,
ang_units
=
0.0174532925199
,
attr
=
((
'LOCAL_DATUM'
,
'Local Datum'
),
(
'unit'
,
'Meter'
)),
),
...
...
@@ -173,11 +174,13 @@ class SpatialRefTest(unittest.TestCase):
def
test04_proj
(
self
):
"Test PROJ.4 import and export."
for
s
in
srlist
:
if
s
.
proj
:
srs1
=
SpatialReference
(
s
.
wkt
)
srs2
=
SpatialReference
(
s
.
proj
)
self
.
assertEqual
(
srs1
.
proj
,
srs2
.
proj
)
proj_parts
=
[
'+proj=longlat'
,
'+ellps=WGS84'
,
'+towgs84=0,0,0,0,0,0,0'
,
'+datum=WGS84'
,
'+no_defs'
]
srs1
=
SpatialReference
(
srlist
[
0
]
.
wkt
)
srs2
=
SpatialReference
(
WGS84_proj
)
self
.
assertTrue
(
all
([
part
in
proj_parts
for
part
in
srs1
.
proj
.
split
()]))
self
.
assertTrue
(
all
([
part
in
proj_parts
for
part
in
srs2
.
proj
.
split
()]))
def
test05_epsg
(
self
):
"Test EPSG import."
...
...
@@ -242,9 +245,7 @@ class SpatialRefTest(unittest.TestCase):
def
test12_coordtransform
(
self
):
"Testing initialization of a CoordTransform."
target
=
SpatialReference
(
'WGS84'
)
for
s
in
srlist
:
if
s
.
proj
:
CoordTransform
(
SpatialReference
(
s
.
wkt
),
target
)
CoordTransform
(
SpatialReference
(
srlist
[
0
]
.
wkt
),
target
)
def
test13_attr_value
(
self
):
"Testing the attr_value() method."
...
...
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