{"id":11521,"date":"2020-06-24T13:00:00","date_gmt":"2020-06-24T11:00:00","guid":{"rendered":"https:\/\/www.opengis.ch\/?p=11521"},"modified":"2021-06-06T08:36:03","modified_gmt":"2021-06-06T06:36:03","slug":"generate-dxf-on-qgis-server","status":"publish","type":"post","link":"https:\/\/www.opengis.ch\/fr\/2020\/06\/24\/generate-dxf-on-qgis-server\/","title":{"rendered":"Generate DXF on QGIS server"},"content":{"rendered":"\n<p>Everyone knows QGIS is on the desktop and <a rel=\"noreferrer noopener\" href=\"https:\/\/qfield.org\" target=\"_blank\">mobile devices<\/a>. Many know QGIS is on the web with QGIS server through OGC services. Some know QGIS server has its own extension to generate PDFs. But did you know that QGIS server can also produce DXF files?<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">DXF<\/h2>\n\n\n\n<p>DXF files are mainly used for interchanging CAD drawings, vector geometries with styles and attributes. With a couple of compromises, these files can be imported and exported to and from QGIS.<\/p>\n\n\n\n<p>Due to their heavy use of CAD software, architects work a lot with DXF files. For example, for the Swiss Cadastral Survey (Amtliche Vermessung, Mensuration Officielle) there is a standard with the name GEOBAU-DXF that defines layer names and structure of this file. Architects often request this format from cantonal government agencies when planning construction work.<\/p>\n\n\n\n<p>In the canton of Schaffhausen, there are over 100 downloads per month and it&rsquo;s by far the most demanded format. These files were produced semi-automatically through a separate application and the customers got the data by mail with a link to a zip file. The time between order and delivery was about 20 minutes. With the renewal of the cantonal SDI, including QGIS server for handling OGC services, the situation changed and an update to this process was required.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Optimize the process<\/h2>\n\n\n\n<p>For the canton of Schaffhausen, the goal was to find a solution with existing components of the new SDI, completely based on machine-to-machine communication and to make the turnaround time for the customer as fast as possible. As soon as they realized QGIS server is also able to deliver DXF, this seemed to be the best approach to fulfil their needs concerning the download of GEOBAU-DXF. And, with the help of OPENGIS.ch, it was a full success.<\/p>\n\n\n\n<p>In the cantonal infrastructure, the data is available in a Postgres database, which is regularly filled through an ETL workflow. On top of this database, the canton created a QGIS project with symbology, labelling and layers that reflect the GEOBAU-DXF standard.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1805\" height=\"1013\" src=\"https:\/\/i2.wp.com\/www.opengis.ch\/wp-content\/uploads\/2020\/06\/image.png?fit=750%2C421&amp;ssl=1\" alt=\"\" class=\"wp-image-11522\" srcset=\"https:\/\/i0.wp.com\/www.opengis.ch\/wp-content\/uploads\/2020\/06\/image.png?w=1805&amp;ssl=1 1805w, https:\/\/i0.wp.com\/www.opengis.ch\/wp-content\/uploads\/2020\/06\/image.png?resize=300%2C168&amp;ssl=1 300w, https:\/\/i0.wp.com\/www.opengis.ch\/wp-content\/uploads\/2020\/06\/image.png?resize=1024%2C575&amp;ssl=1 1024w, https:\/\/i0.wp.com\/www.opengis.ch\/wp-content\/uploads\/2020\/06\/image.png?resize=768%2C431&amp;ssl=1 768w, https:\/\/i0.wp.com\/www.opengis.ch\/wp-content\/uploads\/2020\/06\/image.png?resize=370%2C208&amp;ssl=1 370w, https:\/\/i0.wp.com\/www.opengis.ch\/wp-content\/uploads\/2020\/06\/image.png?resize=469%2C264&amp;ssl=1 469w, https:\/\/i0.wp.com\/www.opengis.ch\/wp-content\/uploads\/2020\/06\/image.png?resize=1536%2C862&amp;ssl=1 1536w\" sizes=\"auto, (max-width: 750px) 100vw, 750px\" \/><\/figure>\n\n\n\n<p>With this project published on a QGIS server, it was quickly possible to generate a DXF file, but some improvements were still required in QGIS 3.10.<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Label alignment was not preserved<\/li><li>Altitudes (Z values) of coordinates were not properly exported<\/li><li>Symbols were defined inline and not in blocks<\/li><li>When a layer could have mixed geometry types (points, lines and polygons) there were problems with missing objects and wrong symbology<\/li><\/ul>\n\n\n\n<p>The Canton Shaffausen already had a <a href=\"https:\/\/www.opengis.ch\/qgis-support\/\">support and maintenance<\/a> contract in place with us and used this contract to kick off the development as well as requesting an additional dedicated development contract with specific goals. A couple of iterations later these enhancements were released with the next QGIS versions and are now available for everyone.<\/p>\n\n\n\n<p>As a side effect, the DXF code has been cleaned up. This is now in a much more solid and modular state (it would, for example, be straightforward to expose it as processing algorithm now). Another nice improvement was that QGIS WMS server is now able to handle multiple layers with the same name, merging them to a single layer. This can be interesting if you have to expose the same layer multiple times with points, lines and polygons.<\/p>\n\n\n\n<p>Meanwhile in Schaffhausen, the service is running in production and architects can happily obtain DXF-GEOBAU files by choosing the area of interest on the web map and download the file in no time.<\/p>\n\n\n\n<p>To try it out, head over to the <a href=\"https:\/\/map.geo.sh.ch\/\">geoportal of the canton of Schaffhausen<\/a>, click the three-dots menu and choose GEOBAU-DXF.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"750\" height=\"539\" src=\"https:\/\/i0.wp.com\/www.opengis.ch\/wp-content\/uploads\/2020\/06\/image-3.png?resize=750%2C539&#038;ssl=1\" alt=\"\" class=\"wp-image-11542\" srcset=\"https:\/\/i0.wp.com\/www.opengis.ch\/wp-content\/uploads\/2020\/06\/image-3.png?w=1001&amp;ssl=1 1001w, https:\/\/i0.wp.com\/www.opengis.ch\/wp-content\/uploads\/2020\/06\/image-3.png?resize=300%2C216&amp;ssl=1 300w, https:\/\/i0.wp.com\/www.opengis.ch\/wp-content\/uploads\/2020\/06\/image-3.png?resize=768%2C552&amp;ssl=1 768w, https:\/\/i0.wp.com\/www.opengis.ch\/wp-content\/uploads\/2020\/06\/image-3.png?resize=367%2C264&amp;ssl=1 367w\" sizes=\"auto, (max-width: 750px) 100vw, 750px\" \/><\/figure>\n\n\n\n<p>Or directly use the following download sample link to generate a GEOBAU-DXF file: <a href=\"https:\/\/wfs.geo.sh.ch\/dxfgeobau?SERVICE=WMS&amp;VERSION=1.3.0&amp;REQUEST=GetMap&amp;LAYERS=dxfgeobau&amp;STYLES=&amp;CRS=EPSG%3A2056&amp;BBOX=2690035,1283484,2690299,1283694&amp;WIDTH=1042&amp;HEIGHT=811&amp;FORMAT_OPTIONS=MODE:SYMBOLLAYERSYMBOLOGY;SCALE:500;NO_MTEXT:TEXT&amp;FILE_NAME=geobau.dxf&amp;FORMAT=application\/dxf\">https:\/\/wfs.geo.sh.ch\/dxfgeobau?SERVICE=WMS&amp;VERSION=1.3.0&amp;REQUEST=GetMap&amp;LAYERS=dxfgeobau&amp;STYLES=&amp;CRS=EPSG%3A2056&amp;BBOX=2690035,1283484,2690299,1283694&amp;WIDTH=1042&amp;HEIGHT=811&amp;FORMAT_OPTIONS=MODE:SYMBOLLAYERSYMBOLOGY;SCALE:500;NO_MTEXT:TEXT&amp;FILE_NAME=geobau.dxf&amp;FORMAT=application\/dxf<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Everyone knows QGIS is on the desktop and mobile devices. Many know QGIS is on the web with QGIS server through OGC services. Some know QGIS server has its own extension to generate PDFs. But did you know that QGIS server can also produce DXF files? DXF DXF files are [&hellip;]<\/p>\n","protected":false},"author":3,"featured_media":11522,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_themeisle_gutenberg_block_has_review":false,"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[161],"tags":[125],"class_list":["post-11521","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-uncategorised","tag-qgis-org"],"jetpack_featured_media_url":"https:\/\/i0.wp.com\/www.opengis.ch\/wp-content\/uploads\/2020\/06\/image.png?fit=1805%2C1013&ssl=1","jetpack-related-posts":[{"id":14290,"url":"https:\/\/www.opengis.ch\/fr\/2024\/05\/13\/qgis-dxf-export-enhancements\/","url_meta":{"origin":11521,"position":0},"title":"QGIS DXF Export enhancements","author":"Germ\u00e1n Carrillo","date":"13 mai 2024","format":false,"excerpt":"At OPENGIS.CH, we've been working lately on improving the DXF Export QGIS functionality for the upcoming release 3.38. In the meantime, we've also added nice UX enhancements for making it easier and much more powerful to use! Let's see a short review. DXF Export app dialog and processing algorithm harmonized\u2026","rel":"","context":"Dans &quot;QGIS&quot;","block_context":{"text":"QGIS","link":"https:\/\/www.opengis.ch\/fr\/category\/gis\/qgis\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/www.opengis.ch\/wp-content\/uploads\/2024\/04\/DXF_Override_output_name_poster_image.jpg?fit=1200%2C899&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.opengis.ch\/wp-content\/uploads\/2024\/04\/DXF_Override_output_name_poster_image.jpg?fit=1200%2C899&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/www.opengis.ch\/wp-content\/uploads\/2024\/04\/DXF_Override_output_name_poster_image.jpg?fit=1200%2C899&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/www.opengis.ch\/wp-content\/uploads\/2024\/04\/DXF_Override_output_name_poster_image.jpg?fit=1200%2C899&ssl=1&resize=700%2C400 2x, https:\/\/i0.wp.com\/www.opengis.ch\/wp-content\/uploads\/2024\/04\/DXF_Override_output_name_poster_image.jpg?fit=1200%2C899&ssl=1&resize=1050%2C600 3x"},"classes":[]},{"id":815,"url":"https:\/\/www.opengis.ch\/fr\/2012\/11\/21\/new-qgis-workaround-version\/","url_meta":{"origin":11521,"position":1},"title":"New QGIS workaround version","author":"Marco Bernasocchi","date":"21 novembre 2012","format":false,"excerpt":"Hi all, Good news this time :) Instead of enjoying my weekend doing some wicked diving here in Indonesia, I decided to close myself indoor and get a (re)working vesion of qgis out. As some of you might have noticed or read in my previous post, the latest and greatest\u2026","rel":"","context":"Dans &quot;Android QGIS&quot;","block_context":{"text":"Android QGIS","link":"https:\/\/www.opengis.ch\/fr\/category\/gis\/qfield\/android-qgis\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":14415,"url":"https:\/\/www.opengis.ch\/fr\/2024\/05\/28\/the-postgresql-connection-service-file-and-why-we-love-it\/","url_meta":{"origin":11521,"position":2},"title":"The PostgreSQL Connection Service File and Why We Love It","author":"Dave Signer","date":"28 mai 2024","format":false,"excerpt":"The PostgreSQL Connection Service File pg_service.conf has existed for quite some time and maybe you have already used it sometimes. We love it, and that is why we built the new QGIS plugin PG service parser hashtag#QGIS plugin. Read more about pg_service usages and the new plugin on our latest\u2026","rel":"","context":"Dans &quot;Interlis&quot;","block_context":{"text":"Interlis","link":"https:\/\/www.opengis.ch\/fr\/category\/gis\/interlis\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/www.opengis.ch\/wp-content\/uploads\/2024\/05\/pgserviceparser-1.png?fit=1200%2C750&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.opengis.ch\/wp-content\/uploads\/2024\/05\/pgserviceparser-1.png?fit=1200%2C750&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/www.opengis.ch\/wp-content\/uploads\/2024\/05\/pgserviceparser-1.png?fit=1200%2C750&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/www.opengis.ch\/wp-content\/uploads\/2024\/05\/pgserviceparser-1.png?fit=1200%2C750&ssl=1&resize=700%2C400 2x, https:\/\/i0.wp.com\/www.opengis.ch\/wp-content\/uploads\/2024\/05\/pgserviceparser-1.png?fit=1200%2C750&ssl=1&resize=1050%2C600 3x"},"classes":[]},{"id":8311,"url":"https:\/\/www.opengis.ch\/fr\/2019\/12\/17\/qgis-on-the-road-episode-5\/","url_meta":{"origin":11521,"position":3},"title":"QGIS on the Road: Episode V &#8211; The Web Strikes Back","author":"Marco Bernasocchi","date":"17 d\u00e9cembre 2019","format":false,"excerpt":"Maya expands up into the mountains. She will show us how she uses spatial bookmarks and live layers to manage her hives without leaving home. Maya also starts a new business: with the help of the QGIS' print layout manager, QGIS server and the Lizmap Web Client, she gets her\u2026","rel":"","context":"Dans &quot;QGIS on the road&quot;","block_context":{"text":"QGIS on the road","link":"https:\/\/www.opengis.ch\/fr\/category\/events\/qgis-on-the-road\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/www.opengis.ch\/wp-content\/uploads\/2019\/12\/episode_05.png?fit=1200%2C672&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.opengis.ch\/wp-content\/uploads\/2019\/12\/episode_05.png?fit=1200%2C672&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/www.opengis.ch\/wp-content\/uploads\/2019\/12\/episode_05.png?fit=1200%2C672&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/www.opengis.ch\/wp-content\/uploads\/2019\/12\/episode_05.png?fit=1200%2C672&ssl=1&resize=700%2C400 2x, https:\/\/i0.wp.com\/www.opengis.ch\/wp-content\/uploads\/2019\/12\/episode_05.png?fit=1200%2C672&ssl=1&resize=1050%2C600 3x"},"classes":[]},{"id":14401,"url":"https:\/\/www.opengis.ch\/de\/2024\/05\/28\/the-postgresql-connection-service-file-and-why-we-love-it\/","url_meta":{"origin":11521,"position":4},"title":"Das PostgreSQL Connection Service File und wieso wir es lieben","author":"Dave Signer","date":"28 mai 2024","format":false,"excerpt":"Das PostgreSQL Connection Service File pg_service.conf ist nichts Neues. Es existiert seit einiger Zeit und vermutlich hast du es auch schon verwendet. Aber nicht nur das neue QGIS Plugin PG service parser ist Grund genug, \u00fcber unsere Liebe zu diesem File zu schreiben, auch weil wir generell denken, es ist\u2026","rel":"","context":"Dans &quot;Interlis&quot;","block_context":{"text":"Interlis","link":"https:\/\/www.opengis.ch\/de\/category\/interlis-de\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/www.opengis.ch\/wp-content\/uploads\/2024\/05\/pgserviceparser-1.png?fit=1200%2C750&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.opengis.ch\/wp-content\/uploads\/2024\/05\/pgserviceparser-1.png?fit=1200%2C750&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/www.opengis.ch\/wp-content\/uploads\/2024\/05\/pgserviceparser-1.png?fit=1200%2C750&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/www.opengis.ch\/wp-content\/uploads\/2024\/05\/pgserviceparser-1.png?fit=1200%2C750&ssl=1&resize=700%2C400 2x, https:\/\/i0.wp.com\/www.opengis.ch\/wp-content\/uploads\/2024\/05\/pgserviceparser-1.png?fit=1200%2C750&ssl=1&resize=1050%2C600 3x"},"classes":[]},{"id":177,"url":"https:\/\/www.opengis.ch\/fr\/2011\/04\/20\/qgis-anwendertag-6-5-hsr-rapperswil\/","url_meta":{"origin":11521,"position":5},"title":"QGIS Anwendertag, 6.5., HSR Rapperswil","author":"Marco Bernasocchi","date":"20 avril 2011","format":false,"excerpt":"Am Freitag dem 6. Mai, findet an der Hochschule f\u00fcr Technik Rapperswil das 2. deutschsprachige QGIS Anwendertreffen statt. Quantum GIS (oder kurz QGIS) ist ein benutzerfreundliches Open Source Desktop- und Server-GIS welches sich einer stark wachsenden Anwendergruppe erfreut. Sie finden Infos zu QGIS unter www.qgis.org Nach dem erfolgreichen ersten deutschsprachigen\u2026","rel":"","context":"Dans &quot;GIS&quot;","block_context":{"text":"GIS","link":"https:\/\/www.opengis.ch\/fr\/category\/gis\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]}],"jetpack_shortlink":"https:\/\/wp.me\/pbdBtI-2ZP","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.opengis.ch\/fr\/wp-json\/wp\/v2\/posts\/11521","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.opengis.ch\/fr\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.opengis.ch\/fr\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.opengis.ch\/fr\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/www.opengis.ch\/fr\/wp-json\/wp\/v2\/comments?post=11521"}],"version-history":[{"count":7,"href":"https:\/\/www.opengis.ch\/fr\/wp-json\/wp\/v2\/posts\/11521\/revisions"}],"predecessor-version":[{"id":11546,"href":"https:\/\/www.opengis.ch\/fr\/wp-json\/wp\/v2\/posts\/11521\/revisions\/11546"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.opengis.ch\/fr\/wp-json\/wp\/v2\/media\/11522"}],"wp:attachment":[{"href":"https:\/\/www.opengis.ch\/fr\/wp-json\/wp\/v2\/media?parent=11521"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.opengis.ch\/fr\/wp-json\/wp\/v2\/categories?post=11521"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.opengis.ch\/fr\/wp-json\/wp\/v2\/tags?post=11521"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}