cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
hobe1 Regular Visitor
Regular Visitor

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 boundary shape map.PNGApr 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:

 

 Corrupted map visual in Power BI.PNGCCG 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

Accepted Solutions
HotChilli New Contributor
New Contributor

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

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

hobe1 Regular Visitor
Regular Visitor

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

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 Smiley Happy

 

Many thanks have marked your post as the solution

3 REPLIES 3
HotChilli New Contributor
New Contributor

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

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

hobe1 Regular Visitor
Regular Visitor

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

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 Smiley Happy

 

Many thanks have marked your post as the solution

HotChilli New Contributor
New Contributor

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

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.

Helpful resources

Announcements
GregDeckler

How to Get Your Question Answered Quickly

Power BI Super User, Greg Deckler, explains

Summit North America

Power Platform Summit North America

Register by September 5 to save $200

Back to School Contest

Back to School Contest

Engage and empower students with Power BI!

MBAS Gallery

Watch Sessions On Demand!

Continue your learning in our online communities.

Top Ideas
Users Online
Currently online: 47 members 925 guests
Please welcome our newest community members: