Forum Discussion

mappr's avatar
mappr
New Member
3 months ago
Solved

custom map doesn't display properly

Hello

I downloaded a Statistics Canada census division cartographic boundary file as a shapefile, filtered it in QGIS so it only includes Saskatchewan (comprising 18 census divisions), uploaded the shp, dbf and prj files to mapshaper, checked that the projection was EPSG:4326 and exported it as topojson. When I specify it as the custom map in Power BI, it looks like this:

So you can see the correct shape of Saskatchewan, and the choropleth map appears correctly with values appearing on hover, but it appears projected from a single point in the foreground.

 

I've looked at other community responses on similar questions, and they all say make sure the projection is EPSG:4326 but I've done that (see below) and still have this problem.

 

Any suggestions are much appreciated!

  • I had been using QGIS on a Mac, so I tried it instead on Windows and it finally worked. And the map works in all 3 projections in Power BI.

6 Replies

  • Hi mappr,

    The "projected from a single point" visual is a classic symptom of a quantization/transform issue in the TopoJSON file. When Mapshaper exports with quantization enabled (which is the default), it encodes coordinates as integers with a transform object (scale + translate). Power BI's Shape Map visual does not handle this transform correctly and collapses all polygons toward a single origin point.

    Here are the steps to fix it:

    1. Re-export from Mapshaper without quantization
    In the Mapshaper CLI or web interface, export using the no-quantize flag:

    mapshaper sask2.shp -o format=topojson no-quantize sask2.json

    This ensures coordinates are stored as plain floating-point longitude/latitude values, which Power BI can read correctly.

    2. Alternative: Export as GeoJSON first from QGIS, then convert
    In QGIS, export your layer as GeoJSON (CRS: EPSG:4326), then convert in Mapshaper:

    mapshaper sask2.geojson -o format=topojson no-quantize sask2.json

    3. Set the projection in Power BI Shape Map
    After loading the corrected TopoJSON, in the Format pane > Map settings, set Projection to Equirectangular (not Mercator), which is the correct setting for unprojected WGS84 (EPSG:4326) coordinates.

    4. Verify the key field
    Use Format > Map settings > View map type key to confirm that the CDUID values in your TopoJSON match exactly the values in your data table's Location field.

    The root cause is almost certainly the quantization. Re-exporting with no-quantize should resolve the display issue immediately.

    Hope this helps!

    • mappr's avatar
      mappr
      New Member

      Hi Freginier

       

      Thanks so much for taking the time to respond and provide detailed instructions!

       

      I tried exporting in mapshaper using the no-quantization option, and I checked the outputted json file in a text editor that it no longer contains "transform". However, it still looks the same when I load it into Power BI.

       

      Any other thoughts?

       

      Thanks so much again!

      • mappr's avatar
        mappr
        New Member

        I had been using QGIS on a Mac, so I tried it instead on Windows and it finally worked. And the map works in all 3 projections in Power BI.