<?xml version="1.0" encoding="utf-8"?><rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/">
<channel>
<title>Forum Bauen und Umwelt - Shape-File in DXF-Datei konvertieren</title>
<link>https://bauforum.wirklichewelt.de/</link>
<description>Das Bauforum</description>
<language>de</language>
<item>
<title>Shape-File in DXF-Datei konvertieren</title>
<content:encoded><![CDATA[<p>Es ist gelegentlich schon faszinierend, wie simpel manche Dinge in Python sind, wenn man das richtige Modul importiert. Um zum Beispiel eine Shape-Datei (SHP-Datei) mit GIS-Daten wie Grundstücksgrenzen oder Gebäudeumrissen in eine DXF-Datei umzuformen, die mit nahezu allen CAD-Programmen weiterverarbeitet werden kann, sind gerade einmal drei Zeilen Pythoncode notwendig:</p>
<pre class="python" style="font-family:monospace;"><ol><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #ff7700;">import</span> geopandas <span style="color: #ff7700;">as</span> gpd</div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">daten <span style="color: #000;">=</span> gpd.<span style="color: black;">read_file</span><span style="color: black;">&#40;</span><span style="color: #080;">&quot;Dateiname.zip&quot;</span><span style="color: black;">&#41;</span></div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">daten.<span style="color: black;">boundary</span>.<span style="color: black;">to_file</span><span style="color: black;">&#40;</span><span style="color: #080;">&quot;Dateiname.dxf&quot;</span><span style="color: #000;">,</span> driver<span style="color: #000;">=</span><span style="color: #080;">&quot;DXF&quot;</span><span style="color: black;">&#41;</span></div></li></ol></pre><p>Dabei ist es völlig egal, ob die SHP-Datei in ein ZIP-Archiv eingebettet ist oder ob das Archiv vorher ausgepackt wurde. Die read_file-Methode funktioniert gleichermaßen mit ZIP-Dateien wie mit SHP-Dateien.</p>
<p>Wenn das Modul geopandas nicht gefunden wird, muss es über die Windows-Eingabeaufforderung bzw. über ein Terminalfenter mit dem Befehl<br />
</p>
<pre><code>pip install geopandas</code></pre><p><br />
installiert werden.<br />
In neueren Ubuntu-Linux-Version lautet der Befehl zur Installation<br />
</p>
<pre><code>sudo apt install python3-geopandas</code></pre>]]></content:encoded>
<link>https://bauforum.wirklichewelt.de/index.php?id=11765</link>
<guid>https://bauforum.wirklichewelt.de/index.php?id=11765</guid>
<pubDate>Tue, 27 Feb 2024 14:46:12 +0000</pubDate>
<category>Allgemeines</category><dc:creator>Martin Vogel</dc:creator>
</item>
</channel>
</rss>
