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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
hobe1
Helper II
Helper II

Corrupted map visual using a shp file converted to a topojson using mapshaper

Hi All,

 

I am having trouble producing a topojson that displays the shapefile correctly in power BI using mapshaper, can anyone help? I see I am not the first person to have this issue but none of the previous posts match my particular issue. The source of the shapefile is the Office of National Statistics (ONS) in the UK Apr 2019 CCG boundaries I downloaded the shapefile and associated files including ,prj, dbf,cpg and shx files.

 

I then imported these 5 files into the mapshaper conversion tool the data displayed correctly:

Apr 2019 CCG boundaries imported shapefileApr 2019 CCG boundaries imported shapefile

I then did a conversion from shapefile to topojson using the default settings. The conversion completed with no errors and I saved the 174kb topojson file that was generated. The topojson has the CCG Name as the location identifier. I would have attached the file but apparently cant do that with forum tools

 

When I create a custom CCG boundary shape map in power BI using the topojson as the map source and the CCG Name (from a table) the map visual appears corrupted:

 

 CCG Boundary Shape Map visual corruptedCCG Boundary Shape Map visual corrupted

I have tried generating the topojson with other tools like MyGeo and I get the same result. If I import the topojson generated from Mapshaper back into mapshaper the shape map displays as expected. I have tried generating the topojson from the .shp file only and from the shp, dbf and prj files only end result is the same. I have also tried using the simplify function in mapshaper to lower topojson file size still shape map does not display in Power BI. I should say I have done successful conversions that have displayed correctly on earlier CCG data which makes me think it is something to do with the shapefile source but I do not have the level of knowledge to be able to troubleshoot this, can anyone in the community help? by downloading the ONS files from source link provided and seeing if they can produce a topojson that works because I am stumped. I am using the latest update of Power BI Professional

 

thanks in advance

2 ACCEPTED SOLUTIONS
HotChilli
Super User
Super User

Make sure that you export from mapshaper in 'wgs84' (co-ordinate system).  It's straightforward to do -> In the console in mapshaper type proj wgs84   

then export as topojson

View solution in original post

Hi HotChilli,

 

Did it, worked a treat, I dont suppose you would be willing to explain in a short paragraph and laymans terms why the extra step is needed? Does it allow certain crucial data to be added to the topojson when it is written for export? If so what is that data and why is it important. Alternatively if there is a simple explanation somewhere on the web then just include the link 🙂

 

Many thanks have marked your post as the solution

View solution in original post

4 REPLIES 4
HotChilli
Super User
Super User

Make sure that you export from mapshaper in 'wgs84' (co-ordinate system).  It's straightforward to do -> In the console in mapshaper type proj wgs84   

then export as topojson

Hi HotChilli,

 

Did it, worked a treat, I dont suppose you would be willing to explain in a short paragraph and laymans terms why the extra step is needed? Does it allow certain crucial data to be added to the topojson when it is written for export? If so what is that data and why is it important. Alternatively if there is a simple explanation somewhere on the web then just include the link 🙂

 

Many thanks have marked your post as the solution

It's all about co-ordinate reference systems.  The map you originally loaded into powerbi wasn't in a reference system that it could display as you wanted.  It processed the file and displayed it (after all it was a topojson file with numbers) but not what you wanted.

WGS84 is "Earth-centered, Earth-fixed terrestrial reference system and geodetic datum". It's a standard that allows gps data and a 3d world to be mapped.

All you did in mapshaper was take a file that was in one reference system and convert it to another.  And powerbi liked the wgs84 one.

HI! Jumping on this as I'm trying to work it out too - I had the same issue as above, followed the same instructions and inputted WGS84 into the console on mapshaper, but its pulling up an error saying 'unknown projection description'. Is there a way around this? 

 

I've just imported a administrative boundary shapefile; should it be in a different format? Thank you!

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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