1
내가 그 .PRJ 파일 모양 파일의 그것과) (지도 해안선의 전망을 합성하는 것을 시도하고 말한다 :내 cartopy지도의 투영을 shapefile의 투영과 어떻게 일치시킬 수 있습니까?
GEOGCS["GCS_WGS_1984",DATUM["D_WGS_1984",
SPHEROID["WGS_1984",6378137.0,298.257223563]],
PRIMEM["Greenwich",0.0],UNIT["Degree",0.0174532925199433]]
내 시도는 다음과 같습니다
import matplotlib.pyplot as plt
import cartopy.crs as ccrs
from cartopy.io import shapereader
# set up a map with coastlines around Auckland:
plt.figure(figsize=(10, 10))
platecarree = ccrs.PlateCarree(globe=ccrs.Globe(datum='WGS84'))
ax = plt.axes(projection=platecarree)
extent = [174.25, 175.25, -37.5, -36.5]
ax.set_extent(extent)
ax.coastlines('10m',color='red')
# read in shapefile and plot the polygons:
shp2 = shapereader.Reader('auckland_geology_wgs84gcs.shp')
formations = shp2.records()
for formation in formations:
# plot water blue, and all other rocks yellow
if formation.attributes['MAIN_ROCK'] == b' ':
ax.add_geometries(formation.geometry, ccrs.PlateCarree(),facecolor='blue',alpha=.1)
else:
ax.add_geometries(formation.geometry, ccrs.PlateCarree(), facecolor='yellow',alpha=.1)
plt.show()
나는 세계를주는 시도 매개 변수는 내 평판 정의에서 반지름과 prj 파일의 역 평탄화를 설정했지만, 그 숫자를 설정하거나 변경하더라도 출력에 어떤 변화도 보이지 않았습니다.
또한 add_geometries 호출에서 crs와 같이 정의 된 "platecarree"투영 (WGS84가있는 지구본 호출과 함께)이 출력되지 않으면 비어 있습니다.
은 그대로, 결과는 내가 QGIS 및 데이터 자연 지구 (10m 해안선)에서 다운로드 GADM에서 (뉴질랜드 adm0 수준)를 사용하여 문제를 재현하기 위해 노력했습니다 a projection mismatch