Commit 35d003e9 authored by Eric Duminil's avatar Eric Duminil
Browse files

Convert GSK3 to UTM32N

parent 43f04eee
%% Cell type:code id:8f8408e6 tags:
``` python
import geopandas as gpd
```
%% Cell type:code id:d8461792 tags:
``` python
import shapely
```
%% Cell type:code id:6bbb8081 tags:
``` python
df = gpd.read_file('Klimabäume_SImStadtUTm.shp')
df
```
%% Output
Bezeichnun Baumart Baumhöhe Kronenbrei Stammumfan \
0 Tilia Cordata Linde 15.7 5.3 1.6
1 Tilia Cordata Linde 13.3 4.9 1.0
2 robinia pseudoacacia Robinie 17.7 4.5 1.7
3 Tilia Cordata Linde 15.2 5.0 1.1
4 robinia pseudoacacia Robinie 12.8 4.2 1.1
5 Tilia Cordata Linde 13.8 4.0 1.3
6 Tilia Cordata Linde 14.8 3.4 0.9
7 robinia pseudoacacia Robinie 11.7 4.3 1.2
Durchmesse Breitengra Längengra geometry
0 0.0 9.929020 49.786065 POINT (4350885.205 5518545.260)
1 0.0 9.934286 49.794348 POINT (4351289.754 5519455.869)
2 0.0 9.942568 49.795610 POINT (4351889.764 5519579.827)
3 0.0 9.941988 49.794548 POINT (4351844.785 5519462.881)
4 0.0 9.948865 49.787736 POINT (4352319.118 5518691.817)
5 0.0 9.950083 49.787398 POINT (4352405.769 5518651.799)
6 0.0 9.964250 49.791921 POINT (4353439.338 5519127.002)
7 0.0 9.962506 49.792440 POINT (4353315.381 5519188.121)
%% Cell type:code id:e0ceeefa tags:
``` python
df = df.to_crs(25832)
```
%% Cell type:code id:208df86b tags:
``` python
df = df.drop(columns=['Breitengra', 'Längengra'])
```
%% Cell type:code id:d72ccb64 tags:
``` python
df.crs
```
%% Output
<Projected CRS: EPSG:25832>
Name: ETRS89 / UTM zone 32N
Axis Info [cartesian]:
- E[east]: Easting (metre)
- N[north]: Northing (metre)
Area of Use:
- name: Europe between 6°E and 12°E: Austria; Belgium; Denmark - onshore and offshore; Germany - onshore and offshore; Norway including - onshore and offshore; Spain - offshore.
- bounds: (6.0, 38.76, 12.01, 84.33)
Coordinate Operation:
- name: UTM zone 32N
- method: Transverse Mercator
Datum: European Terrestrial Reference System 1989 ensemble
- Ellipsoid: GRS 1980
- Prime Meridian: Greenwich
%% Cell type:code id:8fbe258a tags:
``` python
df
```
%% Output
Bezeichnun Baumart Baumhöhe Kronenbrei Stammumfan \
0 Tilia Cordata Linde 15.7 5.3 1.6
1 Tilia Cordata Linde 13.3 4.9 1.0
2 robinia pseudoacacia Robinie 17.7 4.5 1.7
3 Tilia Cordata Linde 15.2 5.0 1.1
4 robinia pseudoacacia Robinie 12.8 4.2 1.1
5 Tilia Cordata Linde 13.8 4.0 1.3
6 Tilia Cordata Linde 14.8 3.4 0.9
7 robinia pseudoacacia Robinie 11.7 4.3 1.2
Durchmesse geometry
0 0.0 POINT (566791.332 5515133.591)
1 0.0 POINT (567158.925 5516059.074)
2 0.0 POINT (567753.134 5516206.830)
3 0.0 POINT (567712.891 5516088.252)
4 0.0 POINT (568217.362 5515337.228)
5 0.0 POINT (568305.490 5515300.728)
6 0.0 POINT (569318.620 5515816.558)
7 0.0 POINT (569192.394 5515872.638)
%% Cell type:code id:38000721 tags:
``` python
df.to_file("Klimabäume_SImStadt.shp")
```
%% Cell type:code id:c26ecc76 tags:
``` python
poly = df.geometry[0]
```
%% Cell type:code id:43d36ff6 tags:
``` python
poly
```
%% Output
<POINT (566791.332 5515133.591)>
%% Cell type:code id:67377424 tags:
``` python
poly2d = shapely.ops.transform(lambda *args: args[:2], poly)
```
%% Cell type:code id:9bab724b tags:
``` python
poly2d.wkt
```
%% Output
'POINT (566791.3315698793 5515133.590795662)'
%% Cell type:code id:29537f36 tags:
``` python
```
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment