cancel
Showing results for 
Search instead for 
Did you mean: 
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 II
Super User II

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 II
Super User II

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

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
PBI User Groups

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group!

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!

secondImage

Are You Ready?

Test your skills now with the Cloud Skills Challenge.

Top Solution Authors