Change Shapefile CRS.ipynb 20.7 KB
Newer Older
Eric Duminil's avatar
Eric Duminil committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "id": "8f8408e6",
   "metadata": {},
   "outputs": [],
   "source": [
    "import geopandas as gpd"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "id": "d8461792",
   "metadata": {},
   "outputs": [],
   "source": [
    "import shapely"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "id": "6bbb8081",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Bezeichnun</th>\n",
       "      <th>Baumart</th>\n",
       "      <th>Baumhöhe</th>\n",
       "      <th>Kronenbrei</th>\n",
       "      <th>Stammumfan</th>\n",
       "      <th>Durchmesse</th>\n",
       "      <th>Breitengra</th>\n",
       "      <th>Längengra</th>\n",
       "      <th>geometry</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>Tilia Cordata</td>\n",
       "      <td>Linde</td>\n",
       "      <td>15.7</td>\n",
       "      <td>5.3</td>\n",
       "      <td>1.6</td>\n",
       "      <td>0.0</td>\n",
       "      <td>9.929020</td>\n",
       "      <td>49.786065</td>\n",
       "      <td>POINT (4350885.205 5518545.260)</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>Tilia Cordata</td>\n",
       "      <td>Linde</td>\n",
       "      <td>13.3</td>\n",
       "      <td>4.9</td>\n",
       "      <td>1.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>9.934286</td>\n",
       "      <td>49.794348</td>\n",
       "      <td>POINT (4351289.754 5519455.869)</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>robinia pseudoacacia</td>\n",
       "      <td>Robinie</td>\n",
       "      <td>17.7</td>\n",
       "      <td>4.5</td>\n",
       "      <td>1.7</td>\n",
       "      <td>0.0</td>\n",
       "      <td>9.942568</td>\n",
       "      <td>49.795610</td>\n",
       "      <td>POINT (4351889.764 5519579.827)</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>Tilia Cordata</td>\n",
       "      <td>Linde</td>\n",
       "      <td>15.2</td>\n",
       "      <td>5.0</td>\n",
       "      <td>1.1</td>\n",
       "      <td>0.0</td>\n",
       "      <td>9.941988</td>\n",
       "      <td>49.794548</td>\n",
       "      <td>POINT (4351844.785 5519462.881)</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>robinia pseudoacacia</td>\n",
       "      <td>Robinie</td>\n",
       "      <td>12.8</td>\n",
       "      <td>4.2</td>\n",
       "      <td>1.1</td>\n",
       "      <td>0.0</td>\n",
       "      <td>9.948865</td>\n",
       "      <td>49.787736</td>\n",
       "      <td>POINT (4352319.118 5518691.817)</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>Tilia Cordata</td>\n",
       "      <td>Linde</td>\n",
       "      <td>13.8</td>\n",
       "      <td>4.0</td>\n",
       "      <td>1.3</td>\n",
       "      <td>0.0</td>\n",
       "      <td>9.950083</td>\n",
       "      <td>49.787398</td>\n",
       "      <td>POINT (4352405.769 5518651.799)</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>Tilia Cordata</td>\n",
       "      <td>Linde</td>\n",
       "      <td>14.8</td>\n",
       "      <td>3.4</td>\n",
       "      <td>0.9</td>\n",
       "      <td>0.0</td>\n",
       "      <td>9.964250</td>\n",
       "      <td>49.791921</td>\n",
       "      <td>POINT (4353439.338 5519127.002)</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>robinia pseudoacacia</td>\n",
       "      <td>Robinie</td>\n",
       "      <td>11.7</td>\n",
       "      <td>4.3</td>\n",
       "      <td>1.2</td>\n",
       "      <td>0.0</td>\n",
       "      <td>9.962506</td>\n",
       "      <td>49.792440</td>\n",
       "      <td>POINT (4353315.381 5519188.121)</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "             Bezeichnun  Baumart  Baumhöhe  Kronenbrei  Stammumfan  \\\n",
       "0         Tilia Cordata    Linde      15.7         5.3         1.6   \n",
       "1         Tilia Cordata    Linde      13.3         4.9         1.0   \n",
       "2  robinia pseudoacacia  Robinie      17.7         4.5         1.7   \n",
       "3         Tilia Cordata    Linde      15.2         5.0         1.1   \n",
       "4  robinia pseudoacacia  Robinie      12.8         4.2         1.1   \n",
       "5         Tilia Cordata    Linde      13.8         4.0         1.3   \n",
       "6         Tilia Cordata    Linde      14.8         3.4         0.9   \n",
       "7  robinia pseudoacacia  Robinie      11.7         4.3         1.2   \n",
       "\n",
       "   Durchmesse  Breitengra  Längengra                         geometry  \n",
       "0         0.0    9.929020  49.786065  POINT (4350885.205 5518545.260)  \n",
       "1         0.0    9.934286  49.794348  POINT (4351289.754 5519455.869)  \n",
       "2         0.0    9.942568  49.795610  POINT (4351889.764 5519579.827)  \n",
       "3         0.0    9.941988  49.794548  POINT (4351844.785 5519462.881)  \n",
       "4         0.0    9.948865  49.787736  POINT (4352319.118 5518691.817)  \n",
       "5         0.0    9.950083  49.787398  POINT (4352405.769 5518651.799)  \n",
       "6         0.0    9.964250  49.791921  POINT (4353439.338 5519127.002)  \n",
       "7         0.0    9.962506  49.792440  POINT (4353315.381 5519188.121)  "
      ]
     },
     "execution_count": 3,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df = gpd.read_file('Klimabäume_SImStadtUTm.shp')\n",
    "df"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "id": "e0ceeefa",
   "metadata": {},
   "outputs": [],
   "source": [
    "df = df.to_crs(25832)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "id": "208df86b",
   "metadata": {},
   "outputs": [],
   "source": [
    "df = df.drop(columns=['Breitengra', 'Längengra'])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "id": "d72ccb64",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<Projected CRS: EPSG:25832>\n",
       "Name: ETRS89 / UTM zone 32N\n",
       "Axis Info [cartesian]:\n",
       "- E[east]: Easting (metre)\n",
       "- N[north]: Northing (metre)\n",
       "Area of Use:\n",
       "- 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.\n",
       "- bounds: (6.0, 38.76, 12.01, 84.33)\n",
       "Coordinate Operation:\n",
       "- name: UTM zone 32N\n",
       "- method: Transverse Mercator\n",
       "Datum: European Terrestrial Reference System 1989 ensemble\n",
       "- Ellipsoid: GRS 1980\n",
       "- Prime Meridian: Greenwich"
      ]
     },
     "execution_count": 6,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df.crs"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "id": "8fbe258a",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Bezeichnun</th>\n",
       "      <th>Baumart</th>\n",
       "      <th>Baumhöhe</th>\n",
       "      <th>Kronenbrei</th>\n",
       "      <th>Stammumfan</th>\n",
       "      <th>Durchmesse</th>\n",
       "      <th>geometry</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>Tilia Cordata</td>\n",
       "      <td>Linde</td>\n",
       "      <td>15.7</td>\n",
       "      <td>5.3</td>\n",
       "      <td>1.6</td>\n",
       "      <td>0.0</td>\n",
       "      <td>POINT (566791.332 5515133.591)</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>Tilia Cordata</td>\n",
       "      <td>Linde</td>\n",
       "      <td>13.3</td>\n",
       "      <td>4.9</td>\n",
       "      <td>1.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>POINT (567158.925 5516059.074)</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>robinia pseudoacacia</td>\n",
       "      <td>Robinie</td>\n",
       "      <td>17.7</td>\n",
       "      <td>4.5</td>\n",
       "      <td>1.7</td>\n",
       "      <td>0.0</td>\n",
       "      <td>POINT (567753.134 5516206.830)</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>Tilia Cordata</td>\n",
       "      <td>Linde</td>\n",
       "      <td>15.2</td>\n",
       "      <td>5.0</td>\n",
       "      <td>1.1</td>\n",
       "      <td>0.0</td>\n",
       "      <td>POINT (567712.891 5516088.252)</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>robinia pseudoacacia</td>\n",
       "      <td>Robinie</td>\n",
       "      <td>12.8</td>\n",
       "      <td>4.2</td>\n",
       "      <td>1.1</td>\n",
       "      <td>0.0</td>\n",
       "      <td>POINT (568217.362 5515337.228)</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>Tilia Cordata</td>\n",
       "      <td>Linde</td>\n",
       "      <td>13.8</td>\n",
       "      <td>4.0</td>\n",
       "      <td>1.3</td>\n",
       "      <td>0.0</td>\n",
       "      <td>POINT (568305.490 5515300.728)</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>Tilia Cordata</td>\n",
       "      <td>Linde</td>\n",
       "      <td>14.8</td>\n",
       "      <td>3.4</td>\n",
       "      <td>0.9</td>\n",
       "      <td>0.0</td>\n",
       "      <td>POINT (569318.620 5515816.558)</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>robinia pseudoacacia</td>\n",
       "      <td>Robinie</td>\n",
       "      <td>11.7</td>\n",
       "      <td>4.3</td>\n",
       "      <td>1.2</td>\n",
       "      <td>0.0</td>\n",
       "      <td>POINT (569192.394 5515872.638)</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "             Bezeichnun  Baumart  Baumhöhe  Kronenbrei  Stammumfan  \\\n",
       "0         Tilia Cordata    Linde      15.7         5.3         1.6   \n",
       "1         Tilia Cordata    Linde      13.3         4.9         1.0   \n",
       "2  robinia pseudoacacia  Robinie      17.7         4.5         1.7   \n",
       "3         Tilia Cordata    Linde      15.2         5.0         1.1   \n",
       "4  robinia pseudoacacia  Robinie      12.8         4.2         1.1   \n",
       "5         Tilia Cordata    Linde      13.8         4.0         1.3   \n",
       "6         Tilia Cordata    Linde      14.8         3.4         0.9   \n",
       "7  robinia pseudoacacia  Robinie      11.7         4.3         1.2   \n",
       "\n",
       "   Durchmesse                        geometry  \n",
       "0         0.0  POINT (566791.332 5515133.591)  \n",
       "1         0.0  POINT (567158.925 5516059.074)  \n",
       "2         0.0  POINT (567753.134 5516206.830)  \n",
       "3         0.0  POINT (567712.891 5516088.252)  \n",
       "4         0.0  POINT (568217.362 5515337.228)  \n",
       "5         0.0  POINT (568305.490 5515300.728)  \n",
       "6         0.0  POINT (569318.620 5515816.558)  \n",
       "7         0.0  POINT (569192.394 5515872.638)  "
      ]
     },
     "execution_count": 7,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "id": "38000721",
   "metadata": {},
   "outputs": [],
   "source": [
Eric Duminil's avatar
Eric Duminil committed
407
    "df.to_file(\"Klimabäume_SImStadt.shp\", encoding='utf-8')"
Eric Duminil's avatar
Eric Duminil committed
408
409
410
411
412
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
Eric Duminil's avatar
Eric Duminil committed
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
   "id": "40cad6d4",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Bezeichnun</th>\n",
       "      <th>Baumart</th>\n",
       "      <th>Baumhöhe</th>\n",
       "      <th>Kronenbrei</th>\n",
       "      <th>Stammumfan</th>\n",
       "      <th>Durchmesse</th>\n",
       "      <th>geometry</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>Tilia Cordata</td>\n",
       "      <td>Linde</td>\n",
       "      <td>15.7</td>\n",
       "      <td>5.3</td>\n",
       "      <td>1.6</td>\n",
       "      <td>0.0</td>\n",
       "      <td>POINT (566791.332 5515133.591)</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>Tilia Cordata</td>\n",
       "      <td>Linde</td>\n",
       "      <td>13.3</td>\n",
       "      <td>4.9</td>\n",
       "      <td>1.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>POINT (567158.925 5516059.074)</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>robinia pseudoacacia</td>\n",
       "      <td>Robinie</td>\n",
       "      <td>17.7</td>\n",
       "      <td>4.5</td>\n",
       "      <td>1.7</td>\n",
       "      <td>0.0</td>\n",
       "      <td>POINT (567753.134 5516206.830)</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>Tilia Cordata</td>\n",
       "      <td>Linde</td>\n",
       "      <td>15.2</td>\n",
       "      <td>5.0</td>\n",
       "      <td>1.1</td>\n",
       "      <td>0.0</td>\n",
       "      <td>POINT (567712.891 5516088.252)</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>robinia pseudoacacia</td>\n",
       "      <td>Robinie</td>\n",
       "      <td>12.8</td>\n",
       "      <td>4.2</td>\n",
       "      <td>1.1</td>\n",
       "      <td>0.0</td>\n",
       "      <td>POINT (568217.362 5515337.228)</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>Tilia Cordata</td>\n",
       "      <td>Linde</td>\n",
       "      <td>13.8</td>\n",
       "      <td>4.0</td>\n",
       "      <td>1.3</td>\n",
       "      <td>0.0</td>\n",
       "      <td>POINT (568305.490 5515300.728)</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>Tilia Cordata</td>\n",
       "      <td>Linde</td>\n",
       "      <td>14.8</td>\n",
       "      <td>3.4</td>\n",
       "      <td>0.9</td>\n",
       "      <td>0.0</td>\n",
       "      <td>POINT (569318.620 5515816.558)</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>robinia pseudoacacia</td>\n",
       "      <td>Robinie</td>\n",
       "      <td>11.7</td>\n",
       "      <td>4.3</td>\n",
       "      <td>1.2</td>\n",
       "      <td>0.0</td>\n",
       "      <td>POINT (569192.394 5515872.638)</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "             Bezeichnun  Baumart  Baumhöhe  Kronenbrei  Stammumfan  \\\n",
       "0         Tilia Cordata    Linde      15.7         5.3         1.6   \n",
       "1         Tilia Cordata    Linde      13.3         4.9         1.0   \n",
       "2  robinia pseudoacacia  Robinie      17.7         4.5         1.7   \n",
       "3         Tilia Cordata    Linde      15.2         5.0         1.1   \n",
       "4  robinia pseudoacacia  Robinie      12.8         4.2         1.1   \n",
       "5         Tilia Cordata    Linde      13.8         4.0         1.3   \n",
       "6         Tilia Cordata    Linde      14.8         3.4         0.9   \n",
       "7  robinia pseudoacacia  Robinie      11.7         4.3         1.2   \n",
       "\n",
       "   Durchmesse                        geometry  \n",
       "0         0.0  POINT (566791.332 5515133.591)  \n",
       "1         0.0  POINT (567158.925 5516059.074)  \n",
       "2         0.0  POINT (567753.134 5516206.830)  \n",
       "3         0.0  POINT (567712.891 5516088.252)  \n",
       "4         0.0  POINT (568217.362 5515337.228)  \n",
       "5         0.0  POINT (568305.490 5515300.728)  \n",
       "6         0.0  POINT (569318.620 5515816.558)  \n",
       "7         0.0  POINT (569192.394 5515872.638)  "
      ]
     },
     "execution_count": 9,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df = gpd.read_file('Klimabäume_SImStadt.shp')\n",
    "df"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "id": "b5df1e3f",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "['Bezeichnun',\n",
       " 'Baumart',\n",
       " 'Baumhöhe',\n",
       " 'Kronenbrei',\n",
       " 'Stammumfan',\n",
       " 'Durchmesse',\n",
       " 'geometry']"
      ]
     },
     "execution_count": 10,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "list(df)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
Eric Duminil's avatar
Eric Duminil committed
593
594
595
596
597
598
599
600
601
   "id": "c26ecc76",
   "metadata": {},
   "outputs": [],
   "source": [
    "poly = df.geometry[0]"
   ]
  },
  {
   "cell_type": "code",
Eric Duminil's avatar
Eric Duminil committed
602
   "execution_count": 12,
Eric Duminil's avatar
Eric Duminil committed
603
604
605
606
607
608
609
610
611
612
613
614
   "id": "43d36ff6",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/svg+xml": [
       "<svg xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"100.0\" height=\"100.0\" viewBox=\"566790.3315698793 5515132.590795662 2.0 2.0\" preserveAspectRatio=\"xMinYMin meet\"><g transform=\"matrix(1,0,0,-1,0,11030267.181591325)\"><circle cx=\"566791.3315698793\" cy=\"5515133.590795662\" r=\"0.06\" stroke=\"#555555\" stroke-width=\"0.02\" fill=\"#66cc99\" opacity=\"0.6\" /></g></svg>"
      ],
      "text/plain": [
       "<POINT (566791.332 5515133.591)>"
      ]
     },
Eric Duminil's avatar
Eric Duminil committed
615
     "execution_count": 12,
Eric Duminil's avatar
Eric Duminil committed
616
617
618
619
620
621
622
623
624
625
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "poly"
   ]
  },
  {
   "cell_type": "code",
Eric Duminil's avatar
Eric Duminil committed
626
   "execution_count": 13,
Eric Duminil's avatar
Eric Duminil committed
627
628
629
630
631
632
633
634
635
   "id": "67377424",
   "metadata": {},
   "outputs": [],
   "source": [
    "poly2d = shapely.ops.transform(lambda *args: args[:2], poly)"
   ]
  },
  {
   "cell_type": "code",
Eric Duminil's avatar
Eric Duminil committed
636
   "execution_count": 14,
Eric Duminil's avatar
Eric Duminil committed
637
638
639
640
641
642
643
644
645
   "id": "9bab724b",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'POINT (566791.3315698793 5515133.590795662)'"
      ]
     },
Eric Duminil's avatar
Eric Duminil committed
646
     "execution_count": 14,
Eric Duminil's avatar
Eric Duminil committed
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "poly2d.wkt"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "29537f36",
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.11.5"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}