Source : install/N4V_FOR_WEBI_DXF_to_N4V_map_QGIS_EN.pdf
N4V FOR WEBI Turning a DXF plan into an N4V map with QGIS Step-by-step guide: from a DXF file to a GeoJSON ready for Mapline and Drillmap DXF import · Extraction · Clean-up · Conversion to polygons · Attributes · GeoJSON export Document Value Document version 2.0 — December 2026 Replaces Transforming a DXF file for N4V integration (2022-10-12) Audience Map designers, SAP BI administrators See also Custom Maps in N4V FOR WEBI — Mapline, Drillmap, DeepMap
N 4 V F O R W E B ITurning a DXF plan into an N4V map with QGIS Contents 1. Purpose and approach………………………………………………………………………………………………………..3 2. Import the DXF file into QGIS………………………………………………………………………………………………4 3. Change the line colour………………………………………………………………………………………………………..4 4. Select the area to extract……………………………………………………………………………………………………5 5. Clean up the layer……………………………………………………………………………………………………………..6 6. Convert lines to polygons — method 1………………………………………………………………………………….8 7. Convert lines to polygons — method 2………………………………………………………………………………….9 8. Fill in the attributes………………………………………………………………………………………………………….11 8.1 Centroid formulas……………………………………………………………………………………………………………………………11 8.2 Add and compute an attribute………………………………………………………………………………………………………….11 9. Add missing polygons……………………………………………………………………………………………………….13 10. Export the layer as GeoJSON…………………………………………………………………………………………….14 11. Result in N4V…………………………………………………………………………………………………………………15 © Need4Viz · need4viz.com2
N 4 V F O R W E B ITurning a DXF plan into an N4V map with QGIS 1. Purpose and approach This guide shows how to turn a plan in DXF format (building, warehouse or site plan…) into a GeoJSON file usable by the N4V map components, using QGIS. The result is then integrated into N4V by following the “Custom Maps in N4V FOR WEBI” guide. Step Goal Chapter Import the DXF Load the line and polygon layers of the plan 2 Make lines visible Change the layer colour if needed 3 Extract the useful areaKeep only the part of the plan to map 4 Clean up Remove useless lines, merge areas 5 Convert to polygons Method 1 (Lines to polygons) or method 2 (Polygonize) 6 and 7 Fill in the attributescode, name, and if needed latitude / longitude 8 Complete Draw the missing polygons 9 Export Save the layer as GeoJSON 10 © Need4Viz · need4viz.com3
N 4 V F O R W E B ITurning a DXF plan into an N4V map with QGIS 2. Import the DXF file into QGIS 1.Drag the .dxf file into the QGIS project area. A window lists the layers detected in the file. 2.Select the two layers LineString (lines) and Polygon (polygons), then click Add Layers. Choosing the layers to import Plan imported into QGIS 3. Change the line colour If the lines are hard to see, change their colour: 1.Double-click the layer to modify: the properties window opens. 2.In the Symbology tab, choose Single symbol and change the colour. Layer properties, Symbology tab © Need4Viz · need4viz.com4
N 4 V F O R W E B ITurning a DXF plan into an N4V map with QGIS 4. Select the area to extract 1.Select the layer in the Layers panel. 2.Select the area to extract on the plan. Selected area (in yellow) 3.Save the selection as a new layer: right-click the layer > Export > Save Selected Features As…, GeoJSON format. © Need4Viz · need4viz.com5
N 4 V F O R W E B ITurning a DXF plan into an N4V map with QGIS Exporting the selection: menu, then Save Vector Layer as… window 4.Deselect the original layer and select the new one. The new layer only contains the extracted area 5. Clean up the layer You can remove useless lines, merge areas, rename items… To do so, switch the layer to edit mode (Toggle Editing) and modify it. © Need4Viz · need4viz.com6
N 4 V F O R W E B ITurning a DXF plan into an N4V map with QGIS Switching to edit mode Example after removing several items © Need4Viz · need4viz.com7
N 4 V F O R W E B ITurning a DXF plan into an N4V map with QGIS 6. Convert lines to polygons — method 1 The N4V map module expects polygons. This method converts lines into polygons while keeping the attributes already defined on linestring objects. 1.Menu Vector > Geometry Tools > Lines to Polygons… 2.Choose the input layer, then click Run. Vector > Geometry Tools menu, then the Lines to Polygons algorithm I M P O R T A N T Errors may appear if the algorithm cannot turn some areas into polygons (unclosed lines, fewer than three vertices…). Fix these areas and run it again if needed. Example of errors in the algorithm log © Need4Viz · need4viz.com8
N 4 V F O R W E B ITurning a DXF plan into an N4V map with QGIS 7. Convert lines to polygons — method 2 This method does not keep the attributes already defined on linestring objects: you will have to define them again on the new polygon layer (chapter 8). 1.Select the line layer to transform: 2.Open the toolbox: menu Processing > Toolbox. 3.In Vector geometry, double-click Polygonize. 4.Tick Keep table structure of line layer to keep the attributes to fill in later, then click Run. Polygonize algorithm © Need4Viz · need4viz.com9
N 4 V F O R W E B ITurning a DXF plan into an N4V map with QGIS 5.Switch to edit mode to delete or fix polygons created unnecessarily. 6.Open the attribute table of the new areas, then fill in the attributes (chapter 8). Opening the attribute table © Need4Viz · need4viz.com10
N 4 V F O R W E B ITurning a DXF plan into an N4V map with QGIS 8. Fill in the attributes Attribute Role Mandatory code Links the area (polygon) to the data in the database (Webi)Yes name Area label displayed in Webi Yes latitude, longitude Placement of the pie chart (breakdown of an additional dimension in the Webi chart) on each area; ideally the centroid of the area Georeferenced maps Others (short name, business code…) Alternative labels to the name field in Webi No 8.1 Centroid formulas Map projected in a Lambert-type reference system: latitude : y(centroid($geometry)) longitude : x(centroid($geometry)) Map not projected in a Lambert-type reference system (conversion to WGS 84): latitude : y(transform(centroid($geometry), layer_property('Reprojeté','crs'), 'EPSG:4326')) longitude : x(transform(centroid($geometry), layer_property('Reprojeté','crs'), 'EPSG:4326')) N O T E In these formulas, Reprojeté is the layer name: replace it with the name of your layer. 8.2 Add and compute an attribute 1.Open the attribute table and switch to edit mode . 2.Add an attribute with . The latitude and longitude attributes must be of type Text (string). © Need4Viz · need4viz.com11
N 4 V F O R W E B ITurning a DXF plan into an N4V map with QGIS Add Field window 3.Select the attribute in the selector, then click to open the expression editor. 4.Enter the formula, check the Output preview and confirm. Expression editor 5.Apply the formula to all areas with Update All, then save your edits. T I P An attribute name can also be changed directly in the exported GeoJSON file. © Need4Viz · need4viz.com12
N 4 V F O R W E B ITurning a DXF plan into an N4V map with QGIS Attribute form of an area 9. Add missing polygons 1.Select the layer and switch it to edit mode . 2.Click the Add Polygon Feature tool 3.Left-click each corner of the polygon and finish the shape with a right-click. 4.In the attribute window that opens, fill in the attributes of the new polygon. Entering the attributes of the new polygon © Need4Viz · need4viz.com13
N 4 V F O R W E B ITurning a DXF plan into an N4V map with QGIS 10. Export the layer as GeoJSON 1.Right-click the layer > Export > Save Features As… 2.Choose the GeoJSON format, the file name and the coordinate reference system, then confirm. Exporting to GeoJSON © Need4Viz · need4viz.com14
N 4 V F O R W E B ITurning a DXF plan into an N4V map with QGIS 11. Result in N4V Simplified example of the previous map integrated into the N4V library, as it appears in Webi: Warehouse plan displayed in an N4V component To integrate the GeoJSON file into N4V (enrichment, conversion to .js, map declaration), follow the Custom Maps in N4V FOR WEBI — Mapline, Drillmap, DeepMap guide. T I P The proj4 string, to be copied into the hc-transform property during N4V integration, can be found in the layer CRS: right-click the layer > Layer CRS > Set Layer CRS… Layer CRS > Set Layer CRS…, then the proj4 string in the selector © Need4Viz · need4viz.com15