GDAL 不识别双极圆锥西半球投影
GDAL doesnt recognize bipolar conic western hemisphere projection
我在处理特定投影时遇到问题。它似乎在 proj4 中受支持(http://proj4.org/usage/operations/projections/bipc.html)但是当我在 gdal 中使用它时,它就好像它不存在一样:
gdalsrsinfo:
gdalsrsinfo -o proj4 "+proj=bipc +ns"
产量
failed to load SRS definition
gdalwarp:
gdalwarp -overwrite -s_srs EPSG:4326 -t_srs "+proj=bipc +ns" -of GTiff in.tiff out.tiff
产量
ERROR 1: Translating source or target SRS failed: +proj=bipc +ns
此外,运行 proj -lp
列出它 bipc : Bipolar conic of western hemisphere
。
这些命令对我来说适用于更常见的(重新)投影,我已经在 GDAL 1.11.5 和 2.2.2 上试过了。
为什么这个投影working/how我能识别它?
GDAL 不支持所有投影。您可以使用 Python:
列出这些
#!/usr/bin/env python
from osgeo import osr
from subprocess import Popen, PIPE
osr.UseExceptions()
# Get the list of PROJ.4 projections
proj = {}
p = Popen(['proj', '-lp'], stdout=PIPE)
for line in p.communicate()[0].split('\n'):
if ':' in line:
a, b = line.split(':')
proj[a.strip()] = b.strip()
# Brute force method of testing GDAL's OSR module
supported = set()
not_supported = set()
for k in proj.keys():
sr = osr.SpatialReference()
try:
_ = sr.ImportFromProj4('+proj=' + k)
supported.add(k)
except RuntimeError as e:
not_supported.add(k)
print('{0} total projections, {1} supported, {2} not supported'
.format(len(proj), len(supported), len(not_supported)))
print('Supported: ' + ', '.join(sorted(supported)))
print('Not supported: ' + ', '.join(sorted(not_supported)))
总共 134 个预测,支持 47 个,不支持 87 个
支持:aea、aeqd、bonne、cass、cea、eck1、eck2、eck3、eck4、eck5、eck6、eqc、eqdc、etmerc、gall、geos、gnome、goode、gstmerc、igh、krovak、laea , lcc, merc, mill, moll, nzmg, omerc, ortho, poly, qsc, robin, sinu, somerc, stere, sterea, tmerc, tpeqd, utm, waterg, wag1, wag2, wag3, wag4, wag5, wag6, wag7
不支持:Airy、Aitoff、Alsk、Apian、August、Bacon、Bipc、Boggs、Calcofi、CC、Chamb、Collg、Crest、Denoy、Euler、Fahey、Fouc、fouc_s、Gins8、 gn_sinu, gs48, gs50, hammer, hatano, healpix, imw_p, isea, kav5, kav7, labrd, lagrng, larr, lask, latlon, lcca, leac, lee_os, lonlat, loxim, lsat, mbt_fps, mbt_s, mbtfpp, mbtfpq, mbtfps, mil_os, murd1, murd2, murd3, natearth, nell, nell_h, nicol, nsper, ob_tran, ocea, oea, ortel, pconic, putp1, putp2, putp3, putp3p, putp4p, putp5, putp5p, putp6, putp6p, qua_aut, rhealpix, rouss, rpoly, tcc, tcea, 天梭, tpers, ups、urm5、urmfps、waterg2、waterg3、waterg4、vitk1、were、wink1、wink2、wintri
我在处理特定投影时遇到问题。它似乎在 proj4 中受支持(http://proj4.org/usage/operations/projections/bipc.html)但是当我在 gdal 中使用它时,它就好像它不存在一样:
gdalsrsinfo:
gdalsrsinfo -o proj4 "+proj=bipc +ns"
产量
failed to load SRS definition
gdalwarp:
gdalwarp -overwrite -s_srs EPSG:4326 -t_srs "+proj=bipc +ns" -of GTiff in.tiff out.tiff
产量
ERROR 1: Translating source or target SRS failed: +proj=bipc +ns
此外,运行 proj -lp
列出它 bipc : Bipolar conic of western hemisphere
。
这些命令对我来说适用于更常见的(重新)投影,我已经在 GDAL 1.11.5 和 2.2.2 上试过了。
为什么这个投影working/how我能识别它?
GDAL 不支持所有投影。您可以使用 Python:
列出这些#!/usr/bin/env python
from osgeo import osr
from subprocess import Popen, PIPE
osr.UseExceptions()
# Get the list of PROJ.4 projections
proj = {}
p = Popen(['proj', '-lp'], stdout=PIPE)
for line in p.communicate()[0].split('\n'):
if ':' in line:
a, b = line.split(':')
proj[a.strip()] = b.strip()
# Brute force method of testing GDAL's OSR module
supported = set()
not_supported = set()
for k in proj.keys():
sr = osr.SpatialReference()
try:
_ = sr.ImportFromProj4('+proj=' + k)
supported.add(k)
except RuntimeError as e:
not_supported.add(k)
print('{0} total projections, {1} supported, {2} not supported'
.format(len(proj), len(supported), len(not_supported)))
print('Supported: ' + ', '.join(sorted(supported)))
print('Not supported: ' + ', '.join(sorted(not_supported)))
总共 134 个预测,支持 47 个,不支持 87 个
支持:aea、aeqd、bonne、cass、cea、eck1、eck2、eck3、eck4、eck5、eck6、eqc、eqdc、etmerc、gall、geos、gnome、goode、gstmerc、igh、krovak、laea , lcc, merc, mill, moll, nzmg, omerc, ortho, poly, qsc, robin, sinu, somerc, stere, sterea, tmerc, tpeqd, utm, waterg, wag1, wag2, wag3, wag4, wag5, wag6, wag7
不支持:Airy、Aitoff、Alsk、Apian、August、Bacon、Bipc、Boggs、Calcofi、CC、Chamb、Collg、Crest、Denoy、Euler、Fahey、Fouc、fouc_s、Gins8、 gn_sinu, gs48, gs50, hammer, hatano, healpix, imw_p, isea, kav5, kav7, labrd, lagrng, larr, lask, latlon, lcca, leac, lee_os, lonlat, loxim, lsat, mbt_fps, mbt_s, mbtfpp, mbtfpq, mbtfps, mil_os, murd1, murd2, murd3, natearth, nell, nell_h, nicol, nsper, ob_tran, ocea, oea, ortel, pconic, putp1, putp2, putp3, putp3p, putp4p, putp5, putp5p, putp6, putp6p, qua_aut, rhealpix, rouss, rpoly, tcc, tcea, 天梭, tpers, ups、urm5、urmfps、waterg2、waterg3、waterg4、vitk1、were、wink1、wink2、wintri