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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
ChristianDiscer
Advocate I
Advocate I

Problem using custom shape map

Converted shapefile (projection "transverse_mercator") to a Topo JSON file using the website http://mapshaper.org/ but the resulting JSON file has display problems.  Here's a screenshot: (1) The left image displays the shapefile in ArcGIS. (2) The top & bottom right are the JSON maps displayed within PBI using different projections.

ScreenCaptureScreenCapture

I've even "simplified" the edges of the original shapefile to reduce the number of verticies before converting to JSON.

 

FYI - The location attributes (from an excel file) are correctly applying to the different areas within PBI.

 

Any ideas of what I should do?  Thank you.

 

Power BI version: 2.37.4464.361 64-bit (July, 2016)

Windows version: Windows 7 Pro 64-bit (SP1)

 

 

2 ACCEPTED SOLUTIONS

I believe that when I converted your file, I lined it up with WGS 84 / EPSG 4326 -- geographic.

View solution in original post

@deldersveld Thank you so much, that works great!!  Here's are screen captures of the process.

 

Step #1: select the shapefile using ArcGIS Project tool & set parametersStep #1: select the shapefile using ArcGIS Project tool & set parameters

 

 Step #2: Parameters selectedStep #2: Parameters selected

 

 Step #3: Use mapshaper.org to convert shapefile to json formatStep #3: Use mapshaper.org to convert shapefile to json format

 

 Step #4: Save as TopoJSONStep #4: Save as TopoJSON

 

 Step #5: Use TopoJSON file in Power BIStep #5: Use TopoJSON file in Power BISmiley Very Happy

 

 

 

View solution in original post

24 REPLIES 24
v-caliao-msft
Employee
Employee

Hi @ChristianDiscer,

 

I just tested to import an map.shp file into http://mapshaper.org/ and then export the map into TopoJSON file format. Loading it into Power BI works without any additional configuration from my side, with Power BI the same version as you posted.

 

So I suspect the issue here should be mostly related with the shapefile you used here. If convenient, would it be available for you to share the .shp file here for us to take a further test?

 

In addition, take a try to modify the Format section (the paintbrush icon) General part and see if it would help in such situation.
Adding some reference: Shape Maps in Power BI Desktop (Preview).

 

Regards,

Charlie Liao

Anonymous
Not applicable

Hi Charlie,

I am facing the same issue. Will you please be able to assist me. I can share the .shp file with you.

Thank you very much in advance. Capture.PNG

Thanks @v-caliao-msft

 

Did not see a way to attach a file so use this Dropbox link to grab the file.  The shapefile files are in the ZIP along with an Excel spreadsheet to "link" the map area names to: PolTwpPoly.ZIP via dropbox

 

Also, tried various format settings but no luck.

@ChristianDiscer: This ended up being an issue with the original transverse mercator projection. I opened the file in QGIS, converted it to mercator, and exported it back out as a shapefile. From there, it was the same process using mapshaper to convert to topojson.

 

This file should work: https://www.dropbox.com/s/mx4lig1vmvk4ihw/PolyTestShape.json

 

PolyTest.PNG

 

 

@deldersveld Your file conversion works very well - thank you.

 

However, I don't know how to properly re-project and/or transform a shapefile from my system for mapshaper.org.  ArcGIS contains conversion tools, but I'm not familiar enough to know what settings to use.

 

Should I use a "Geographic" or "Projected" Coordinate System?  Then there are many choices below these two options.

 

I used mapshaper.org to convert your json to a shapefile hoping to see its geographic information, but ArcGIS shows the coordinate system as "undefined."  Which means I don't know what to geographic transformation data settings to use. Smiley Frustrated

 

Does anyone have an idea? 

I believe that when I converted your file, I lined it up with WGS 84 / EPSG 4326 -- geographic.

I know it's been a few years since this thread was discussed - but I have recently experienced the same issues as (in England) the ONS (government data department) changed their default projection mapping in the 2023 updates - this means PowerBI doesn't, by default, recognise the projection settings. I don't have ArcGIS or QGIS, so was struggling to follow this thread, but I came up with a workaround that's fixed all my issues. 

 

This is only helpful to those who are not expert mappers, or who do not have access to QGIS/ArcGIS/other mapping software.

 

Background: I was downloading either GeoJSON or Shapefile documents and using MapShaper (www.mapshaper.org), then simplifying and converting to TopoJSON for use in PowerBI. When I used this in PowerBI, I was getting a picasso-esque visualisation that was mad. Basically, PowerBI uses the WGS84 (EPSG:4326) settings to use the custom mapping tool, and my maps had a different co-ordinate system (which I didn't know, or know how to change). 

 

Fix: I used a GeoData converter to identify what the default projection/co-ordinate system settings on my file was (www.mygeodata.cloud/converter/) - in my case, the ONS file was using the OSGB 1936 / British National Grid (EPSG:27700) (that will make sense to some people, but it didn't to me). You can then confidently change the co-ordinate settings for the shapefile/GeoJSON by doing the following:

  1. Download the GeoJSON/Shapefile.
  2. Upload the file to www.mapshaper.org
  3. Simplify as needed
  4. In a separate tab, use a tool to identify your file's co-ordinate system (www.mygeodata.cloud/conversion) - you're looking for the current EPSG code used by your file.
  5. Back in MapShaper, go to Consol and type the following: -proj from=EPSG:27700 crs=EPSG:4326
  6. Change the "from" EPSG code in red to the EPSG code you found in step (4) (in this case it was the 27700 code from the National Grid system referenced above, and I was changing it to the WGS84 system (EPSG: 4326) needed for PowerBI.
  7. Press enter!
  8. Export from MapShaper as a TopoJSON
  9. Voila! 

You can then import to the shape map in PowerBI with no problems.

Hope this helps someone else ...

 

 

Você pode me ajudar? Já tentei de todas as formas possíveis e não deu certo. O meu continua com o formato do picasso. Posso te enviar o arquivo para ver se consegue entender o que está havendo.


MAPA SHAPE

Aparece assim:

Dhiovana_0-1709949286948.png

 

Quando coloco em WGS84  fica assim:

 

Dhiovana_0-1709950151158.png

 

@deldersveld Thank you so much, that works great!!  Here's are screen captures of the process.

 

Step #1: select the shapefile using ArcGIS Project tool & set parametersStep #1: select the shapefile using ArcGIS Project tool & set parameters

 

 Step #2: Parameters selectedStep #2: Parameters selected

 

 Step #3: Use mapshaper.org to convert shapefile to json formatStep #3: Use mapshaper.org to convert shapefile to json format

 

 Step #4: Save as TopoJSONStep #4: Save as TopoJSON

 

 Step #5: Use TopoJSON file in Power BIStep #5: Use TopoJSON file in Power BISmiley Very Happy

 

 

 

Hello @deldersveld ,

 

I am trying to display City of Detroit along with Counties in Michigan map. I have downloaded and imported the City of Detroit shape file and Michigan Counties shape file to Mapshaper. I have merged 2 layers using "merge-layers" command in Mapshaper console. I was able to see the City of Detroit boundary under Wayne County of Michigan map in the output of merged file.

nallaa_0-1598474368447.png

 

 

I have exported the output in TopoJSON format as a local file. I have converted the output coordinate system to WGS 1984 as suggested in this thread. But, when I loaded this custom map to Shape Map visual in Power BI, I am not able to find the City of Detroit's boundary in Power BI. It is displaying the whole Wayne County with out Detroit polygon.

nallaa_1-1598473933088.png

 

 I have checked Map keys. It is fine. When I filtered City of Detroit in my fields, the Shape Map is approximately zooming in to Detroit's geographic location in default grey color.

nallaa_2-1598473933096.png

 

I need to display boundary for City of Detroit to appear so that one can select Detroit or rest of Wayne County in Power BI Shape map.

Am I missing some steps to be done in Mapshaper? Can you please help me with this?

I am sharing the source file download links below,

http://gis-michigan.opendata.arcgis.com/datasets/cities-v17a/data?where=NAME%20%3D%20%27Detroit%27

http://gis-michigan.opendata.arcgis.com/datasets/counties-v17a/data

Power BI Desktop Version: 2.84.861.0 64-bit (August 2020)

Windows 10 Enterprise

 

Thank you,

Abhinav

nallaa
Frequent Visitor

The issue has been resolved. I have uploaded 2 source files to Mapshaper. One is of Detroit City map and the Other is of Michigan County Map. I have used "erase" command in Mapshaper to erase interecting boundary between Wayne County and Detroit city. Later, I have merged 2 layers using "merge-layers" command. Finally I have used Simplify in mapshaper to repair any interscetions resulted due to above 2 operations.

 

Thank you,

Abhinav

@ChristianDiscer: Great. I don't have an ArcGIS license, and I used QGIS. If/when I blog this, can I use your screenshots for ArcGIS users alongside my own?

Anonymous
Not applicable

Hi there. Will you please be able to help me with the similar problems? Thank you in advance. My email bipinjha@live.com

I  was able to take Shape Files straight to http://MapShaper.org, import them, and in the Console window, run -proj wgs84 and convert the map to something Power BI would accept.  

This response needs to be ranked higher. Our security settings at work prevent us from installing qgis, and arcgis is too expensive. But running "-proj wgs84" in the console dialog worked like a freaking charm.

Yes, by all means use the images in anyway possible.  Thanks again for your help!!

Hi, I'm having this issue with shape maps in powerbi so I think your writeup on the solution might be exactly what I need (I know almost nothing about ArcGIS!) but when I follow the link I get, "

Private Site

This site is currently private. Log in to WordPress.com to request access."

sf09_0-1631552099568.png

I don't have a WordPress login so I wondered if there's any other way I could access this please?

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

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.