Frequently Asked Question

How to reproject your geojson map in QGIS to get a more "realist" view
Dernière mise à jour il y a un an

Symptom

  • When using a geojson map file built with WGS84 coordinates in Webi, the mao may be "stretched".
  • To get a more "real" view, you need to reproject your map (through QGIS for instance) in order to use it in your mapline/drillmap components

Environment

  • QGIS v3.x
  • Need4Viz : all versions

Cause

N4V offline map components cannot project map themselves so a pre-projection need to be provided inside the geojson file.

Resolution

To reproject your map (built with WGS84 coordinates), open the file in QGIS :

image

Choose the "Reproject Layer" tool:

image

Choose a target projection (for european countries, choose for example the "Lambert 93 projection) :

image

Then Run and Close.

Export the Reprojected layer :

image

Save the features in a new json file :

image

Use the reprojected geojson to build your N4V map.

Enrich the properties of the map with the "hc-transform" property. The value for this property can be found in QGIS. Open the Project properties / CRS panel, then choose the projection Lambert 93. In the bottom window, you'll find the "proj4" value corresponding to your projection. This is the value you need to fill in the hc-transform property of your map :

image

Once the map is achieved, you should see a correct projected view in Webi : 

image

Veuillez patienter!

S'il vous plaît patienter... il faudra une seconde !