cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
sabirakh
Frequent Visitor

How to reduce topojson file size?

Hi, I have 2 topojson files for EU countries on a postal code level. However they are more than 1MB and PowerBI is not showing it properly. Can anyone help me to get thise files to reduced size?
Need it urgently.

Thanks!https://drive.google.com/drive/folders/1L7-LsLj1v5lAL8RkQDfz0M06GhlvhfMr?usp=sharing  

9 REPLIES 9
sabirakh
Frequent Visitor

Hello @HotChilli 
Yes, the data for my French map has the postal codes/polygon codes  in the same format and hence I could manage to have the map.

But for Germany and Italy the problem is that , I cannot get to reduce the file size below 1MB (And I think the topojson files for Shapemaps in Powerbi has that peculiar requirement).

(For the UK map, I managed to have the map, but I have to zoom in a bit as the initial display is quite small.)

Hi, @sabirakh 

 

If the connected data exceeds 1MB, but it is not particularly large, it can also be displayed all of them. Powerbi will compress it. Have you tried it?

 

Best Regards

Janey Guo

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hey @v-janeyg-msft I tried it, it works sometimes, not all the time. For eg: Germany has a lot of zipcodes, so I get an "!" sign at the top saying that there are too many data points and that I need to filter

Hi, @sabirakh 

 

According to your description, I think you may not need to reduce the file size, because it can import all of them, but  each visual has a limit on the amount of data that can be displayed. So you can try to filter part of data in PQ first, I think this will be a lot easier. 

 

Best Regards

Janey Guo

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

SteveCampbell
Memorable Member
Memorable Member

If there is a lot of data so it may be hard to get them down. You can try:

 

  • Go to https://mapshaper.org/
  • Upload your topojson
  • Clieck "Simplify" in the top right and select OK
  • Use the slider to select the simplification. The more you simplify, the smaller the file, but the less accurate the lines. 
  • Click "Export", select topojson, then click Export(don;t type in the box)

 

You can esperiment with the level of simplification to see the best filesize



Did I answer your question? Mark my post as a solution! Proud to be a Super User!


Connect with me!
Stay up to date on  
Read my blogs on  



Hello Steve! Thanks for the suggestion!
But I did try it and it does not get reduced less than 1MB.

Can you please suggest any ideas or workaround?

I had a look at the file and I think the problem is not the size.  I think the 'attribute' data is missing or not set up correctly.   Hit 'View map keys' from the Shapemap Format section.  I didn't get anything.

Hello @HotChilli . I have been using similar files for France and Spain like the one below and they do not have attributes as well. But they seem to work perfectly. Any idea?


(GB file below)
https://drive.google.com/file/d/1UB7fBqv4irw9vsgEs2_qc88csQ40vJ1t/view?usp=sharing 

 

sabirakh_0-1607735215531.png

 

Those polygon numbers in the picture.  Do they match up with a field in your data?  They look like French postcodes.

 

The gb file has attributes like UKTN29.  TN29 is a postcode area.  I was able to get the UK map to work in powerbi (after editing it in mapshaper) - it displayed too small initially.

I created some sample data without "UK" at the start - it didn't work.  I added "UK" - it worked. 

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

November Power BI Update 768x460.png

Check it Out!

Click here to read more about the November 2021 Updates!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.