1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

Automating GIS Processes 2024 写経 Lesson 3(Exercise 3、Hints)

Last updated at Posted at 2025-06-26

To start this assignment, accept the GitHub classroom assignment, and clone your own repository, e.g., in a CSC Noppe instance. Make sure you commit and push all changes you make (you can revisit instructions on how to use git and the JupyterLab git-plugin on the website of the Geo-Python course.

To preview the exercise without logging in, you can find the open course copy of the course’s GitHub repository at github.com/Automating-GIS-processes-II-2024/Exercise-3. Don’t attempt to commit changes to that repository, but rather work with your personal GitHub classroom copy (see above).

上記は、GitHub classroomに関する話で関係なさそうなので、省略します。

Hints

Coordinate reference systems

Note
Remember the difference between defining a CRS and re-projecting a layer into a new CRS! Before re-projecting, the layer should have a valid CRS definition, which you can check like this: data.crs.

CRSを定義すること、CRSを再投影すること、この違いを押さえておきましょう!
再投影の前に、投影のデータには妥当なCRSが定義されているべきです。data.crsで確認できます。

To define a projection, assign a new CRS to a geo-data frame’s crs property:

geoDataFrameのcrsプロパティに新しいCRSを設定します。

data.crs = pyproj.CRS("EPSG:4326")

This will update the metadata, only. The actual coordinate values will remained unmodified. Use this only if the original CRS definition is missing or invalid.

これはメタデータが更新されるだけで、実際の座標値は更新されません。
なので、CRSが未定義、または、妥当でない場合のみ使うことになります。

To re-project a geopandas.GeoDataFrame, use its to_crs() method:

geoDataFrameを再投影するには、to_crs()メソッドを使います。

data = data.to_crs("EPSG:4326")

This will actually transform the geometry features of the data frame, AND re-define the CRS definition stored in the .crs property.

この場合は、geoDataFrameにある地物の座標は変換されます。また、geoDataFrameのcrsプロパティにも再定義されたCRSが設定されます。

次回は以下です。

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?