7.1. Lesson: 데이터 재투영 및 변환

좌표계(CRS) 얘기를 다시 해봅시다. 이전에 간략하게 언급했지만, 실제로 어떤 의미를 가지고 있는지에 대해서는 설명하지 않았습니다.

이 강의의 목표: 벡터 데이터를 재투영하고 변환하기.

7.1.1. basic Follow Along: 투영

맵 자체는 물론 모든 데이터는 현재 WGS84라는 CRS를 사용하고 있습니다. WGS84는 데이터를 표현하는 데 쓰이는 매우 흔한 지리좌표계(GCS)입니다. 그러나 이제 곧 설명할 문제점도 가지고 있습니다.

  1. Save your current map

  2. Then open the map of the world which you’ll find under exercise_data/world/world.qgs

  3. Zoom in to South Africa by using the Zoom In tool

  4. Try setting a scale in the Scale field, which is in the Status Bar along the bottom of the screen. While over South Africa, set this value to 1:5 000 000 (one to five million).

  5. Pan around the map while keeping an eye on the Scale field

Notice the scale changing? That’s because you’re moving away from the one point that you zoomed into at 1:5 000 000, which was at the center of your screen. All around that point, the scale is different.

그 이유를 이해하려면, 지구의를 생각해보십시오. 남북 방향으로 선이 뻗어 있습니다. 이 경도 선들은 적도에서는 멀리 떨어져 있지만 남극/북극에서 만납니다.

GCS는 이 구체 상에서 정의되지만, 여러분의 모니터는 평면입니다. 평면에서 구체를 표현하려 할 때, 마치 테니스 공을 잘라서 평평하게 펼치려고 할 때처럼, 왜곡이 발생합니다. 즉 맵 상에서는 경도 선들이 (서로 만나야 할) 극지방에서도 평행하게 떨어져 있습니다. 다시 말해 맵 상에서 적도로부터 멀어질수록, 여러분이 보는 오브젝트의 축척이 점점 커진다는 뜻입니다. 한 마디로 말하자면 맵 상의 위치에 따라 축척이 계속 변한다는 말이지요!

이 문제를 해결하기 위해 투영좌표계(PCS)를 대신 사용해봅시다. PCS는 축척 변화를 감안하여 바로잡는 방식으로 데이터를 《투영》하거나 변환합니다. 따라서 축척을 일정하게 유지하려면 PCS를 이용해서 데이터를 재투영해야 합니다.

7.1.2. basic Follow Along: 《실시간》 재투영

By default, QGIS reprojects data 《on the fly》. What this means is that even if the data itself is in another CRS, QGIS can project it as if it were in a CRS of your choice.

You can change the CRS of the project by clicking on projectionEnabled button in the bottom right corner of QGIS.

  1. In the dialog that appears, type the word global into the Filter field. One CRS (NSIDC EASE-Grid 2.0 Global, EPSG:6933) should appear in the list below.

  2. Click on the NSIDC EASE-Grid 2.0 Global to select it, then click OK.

    남아프리카 공화국의 형태가 어떻게 변하는지 보셨습니까? 투영체를 바꾸면 지구 상의 오브젝트의 형태가 바뀝니다.

  3. Zoom in to a scale of 1:5 000 000 again, as before.

  4. 맵을 이리저리 이동해보십시오.

    축척이 일정하게 유지됩니다!

서로 다른 CRS를 이용하는 데이터셋을 결합하는 데에도 《실시간》 재투영을 사용할 수 있습니다.

  1. Add another vector layer to your map which has the data for South Africa only. You’ll find it as exercise_data/world/RSA.shp.

  2. Load it and a quick way to see what is its CRS is by hovering the mouse over the layer in the legend. It is EPSG:3410.

보이십니까?

The layer is visible even if it has a different CRS from the continents one.

7.1.3. moderate Follow Along: 다른 CRS로 데이터셋 저장

Sometimes you need to export an existing dataset in another CRS. As we will see in the next lesson, if you need to make some distance calculations on layer, it is always better to have the layer in a projected coordinate system.

Be aware that the 〈on the fly〉 reprojection is related to the project and not to single layers. This means that layers can have different CRS from the project even if you see them in the correct position.

But you can easily export the layer in another CRS.

  1. Right-click on the buildings layer in the Layers panel

  2. Select Export ‣ Save Features As… in the menu that appears. You will be shown the Save Vector Layer as… dialog.

  3. Click on the Browse button next to the File name field

  4. Navigate to exercise_data/ and specify the name of the new layer as buildings_reprojected.shp.

  5. We must change the value of the CRS. Only the recent CRSs used will be shown in the drop down menu. Click on the setProjection button next to the dropdown menu.

  6. The CRS Selector dialog will now appear. In its Filter field, search for 34S.

  7. Select WGS 84 / UTM zone 34S from the list

    ../../../_images/CRSselector.png
  8. Leave the other options unchanged. The Save Vector Layer as… dialog now looks like this:

    ../../../_images/save_vector_dialog.png
  9. Click OK

You can now compare the old and new projections of the layer and see that they are in two different CRS but they are still overlapping.

7.1.4. hard Follow Along: 사용자 지정 투영체 생성

QGIS에 기본으로 포함된 투영체 외에도 많은 투영체가 있습니다. 여러분 자신만의 투영체를 생성할 수도 있습니다.

  1. Start a new map

  2. Load the world/oceans.shp dataset

  3. Go to Settings ‣ Custom Projections… and you’ll see this dialog.

    ../../../_images/custom_crs.png
  4. Click on the signPlus button to create a new projection

  5. An interesting projection to use is called Van der Grinten I. Enter its name in the Name field.

    이 투영체는 다른 대부분 투영체와는 달리 사각 면이 아니라 원형 면에 지구를 표현합니다.

  6. Add the following string in the Parameters field:

    +proj=vandg +lon_0=0 +x_0=0 +y_0=0 +R_A +a=6371000 +b=6371000 +units=m +no_defs
    
    ../../../_images/new_crs_parameters.png
  7. Click OK

  8. Click on the projectionEnabled button to change the project CRS

  9. Choose your newly defined projection (search for its name in the Filter field)

  10. 이 투영체를 적용하면 맵이 다음과 같이 재투영될 것입니다.

    ../../../_images/van_grinten_projection.png

7.1.5. In Conclusion

목적에 따라 유용한 투영체도 달라집니다. 올바른 투영체를 선택함으로써 사용자 맵 상에 피처를 정확하게 표현할 수 있게 됩니다.

7.1.6. Further Reading

Materials for the Advanced section of this lesson were taken from this article.

Further information on Coordinate Reference Systems is available here.

7.1.7. What’s Next?

다음 강의에서는 QGIS의 다양한 벡터 분석 도구들을 이용해 벡터 데이터를 분석하는 방법에 대해 배워보겠습니다.