Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
masplin
Impactful Individual
Impactful Individual

Trying to build a map using UK MSOA boundaries without success

I've done this rpeviously using a level up, but trying to map daya at the UK MSOA level

 

I downlaoded this file form ONS of what I think are boundaries as GeoJSON file MSOA Boundaries ONS 

 

I then sent that to https://mapshaper.org/  to convert to a TopoJSON file. Previewed looked fine

 

In power BI I chose map and in map settings custom map, uploaded JSON file and Orthographic.

 

However instead of getting something that looks like the UK I get this.  Its extremly slow which I was expecting. 

Capture.JPG

If I click on eventualy I get this sort of thingwhich is looknig good as MSOA21NM is the name I have in my data. 

 

Capture.JPG

 

Question is do I need to name my field the same as this field name in the JSON for it to work? I tried renaming the field in my dataset, but didnt work

 

Any reason it is rendering liek a globe instead of the country shape?  Not enough resources etc

 

Any suggestions appreciated. Might just be too much for power BI.

 

Mike

1 ACCEPTED SOLUTION

I'm afraid it's quite a bit more complex than that.

 

Your GeoJSON file is in BNG projection (EPSG:27700)  which cannot be used in Power BI (neither the format nor the projection). 

First step:  Convert your ONS data from EPSG:27700 to EPSG:4326  .  I used QGIS for that, you can use whatever tool you prefer. Here's a general approach: QGIS – CROPPING AND CONVERTING .SHP FILES TO TOPOJSON FORMAT – Daniels Coding Blog (wordpress.com)

Second step: Convert from GeoJSON to TopoJSON (as you already did, via MapShaper)

Third step:  Have columns in your Power BI data that correspond to the shape attributes in your file.  In your case that would be (at minimum) MSOA21CD. 

Fourth step: load the custom map into the shape map visual, it will automatically display in a suitable (ish) projection.  Mercator is not necessarily the best for the UK locations but it is what it is.

 

This stuff (especially QGIS) is rather technical, and highly demanding of your computer resources. Bring patience and maybe call a friend.

 

View solution in original post

7 REPLIES 7
masplin
Impactful Individual
Impactful Individual

Thisis the standard shape map.  I've used a topojson file ofr Local authority and orthogrpahic which works fine, but the next level down MSOA therer are 20 x more areas so it is a massive file.  I've tried different files that have the boundaries in clipped detail.  Full files are below

 

Full Geo JSON 

 

Full TopoJSON 

 

Mapshaper seems to allow you to simplify the boundaries so below is 1pct version

 

1pct TopoJSON 

 

Be interested if you can get it to work

 

LA version looks like this

 

Capture.JPG

Mapshaper doesn't know what the original projection is. Any idea as to what it could be? EPSG:27700  ?

 

Great Britain

To convert from British National Grid, use projection EPSG:27700. In the long-established, but now less-preferred proj.4 format, the projection is defined as

+proj=tmerc +lat_0=49 +lon_0=-2 +k=0.9996012717 +x_0=400000 +y_0=-100000 +datum=OSGB36 +units=m

 

So yes, you need to convert from BNG to WGS84  (for example with QGIS) and then from GeoJSON to TopoJSON (with Mapshaper).

 

lbendlin_0-1689613406498.png

lbendlin_1-1689613449110.png

 

 

masplin
Impactful Individual
Impactful Individual

sorry i have no idea what you mean.  The download from ONS was a Geojson file so assume just needed to convert that. Mapshapper showed the country correctly.  How have you managed to get the correct looking map? I tried all 3 projections and could get what you have?   Can you explain steps as i'm not very tech savvy?  Much appreciated

I'm afraid it's quite a bit more complex than that.

 

Your GeoJSON file is in BNG projection (EPSG:27700)  which cannot be used in Power BI (neither the format nor the projection). 

First step:  Convert your ONS data from EPSG:27700 to EPSG:4326  .  I used QGIS for that, you can use whatever tool you prefer. Here's a general approach: QGIS – CROPPING AND CONVERTING .SHP FILES TO TOPOJSON FORMAT – Daniels Coding Blog (wordpress.com)

Second step: Convert from GeoJSON to TopoJSON (as you already did, via MapShaper)

Third step:  Have columns in your Power BI data that correspond to the shape attributes in your file.  In your case that would be (at minimum) MSOA21CD. 

Fourth step: load the custom map into the shape map visual, it will automatically display in a suitable (ish) projection.  Mercator is not necessarily the best for the UK locations but it is what it is.

 

This stuff (especially QGIS) is rather technical, and highly demanding of your computer resources. Bring patience and maybe call a friend.

 

masplin
Impactful Individual
Impactful Individual

That brilliant. I'm off on holiday tomorrow so wil lgive it a go when I get back

 

Thanks again. 

lbendlin
Super User
Super User

I don't think you want to use orthographic projection. try one of the other values.

 

Which map visual is this?

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.