Creating my own Map Shapefiles for Power BI

, 2019-01-15 (first published: )

(2019-Jan-06) In the past, I used to always rely on shapefiles crafted by others to create my map visualizations in Microsoft Power platform. City regions, country province territories, other shapefiles came from open data repositories and constructed by other people. After writing my last blog post on Using WGS 84 shape maps in Power BI and getting more experience with QGIS, I thought that I could create my own map shapefiles and test them in Power BI too.

Hypothetically, I could try to locate and create a polygon of a pentagon-shaped building, or simply follow a circular shape of the corporate office of the Apple company in California. Or maybe, just by going to the southern hemisphere in order to try and replicate a sea-shell-like-roof of the Syndey Opera House in Australia; or reproduce square formation of the Egyptian pyramids.



I've created shapefiles for a couple of those buildings, however, I will show the simplest one in this blog post and lead you into a journey to Pyramids of Giza in Egypt, which from the airview is a simple structure of three square shapes, very easy to start!

About a year ago, I had already blogged about using QGIS tool to create shape figures and test them visually in SQL Server - Geometry Objects in SQL Server using Latitude/Longitude coordinates. So, I won't get into much of details of leveraging features of the QGIS tool, you can try and use other GIS software applications as well.

1) Open Street Maps (OSM) layer in QGIS
Once I open the application and I can add the OSM layer to my project by going to Web > QuickMapServices > OSM > OSM Standard. Then I visually locate three Giza Pyramids on my map.


2) Shapefile layer 
Then I add a new shapefile layer to create three square polygons and name this layer as Pyramid_shapes_wgs84.


Important thing: please make sure to set your Coordinate Reference Systems (CRS) to EPSG 4326 http://spatialreference.org/ref/epsg/wgs-84/. It will provide Latitude & Longitude of your GIS data. This could be done either on your GIS project level or shapefile layer level. Otherwise, If you don't use WGS 84 (EPSG 4326) coordinate reference system, Power BI shape map projection would be visually skewed. 

3) Shapefile conversion to TopoJSON format
With the help of MapShaper, I convert my set of shapefiles
Pyramid_shapes_wgs84.shx
- Pyramid_shapes_wgs84.shp
- Pyramid_shapes_wgs84.qpj
- Pyramid_shapes_wgs84.prj
- Pyramid_shapes_wgs84.dbf
to the new TopoJSON Pyramid_shapes_wgs84.json file.

4) Testing custom shapefile in Power BI
And then I successfully test my own newly created map shapefile by using Shape Map visualization in Power BI.


Conclusions:
a) Custom map shapefiles can be created by regular people like me 🙂 
b) Power BI is a good tool to validate those shapefiles along with using additional data metrics based on your own data case scenario.

It is my new happy data adventure!

Rate

Share

Share

Rate

Related content

Database Mirroring FAQ: Can a 2008 SQL instance be used as the witness for a 2005 database mirroring setup?

Question: Can a 2008 SQL instance be used as the witness for a 2005 database mirroring setup? This question was sent to me via email. My reply follows. Can a 2008 SQL instance be used as the witness for a 2005 database mirroring setup? Databases to be mirrored are currently running on 2005 SQL instances but will be upgraded to 2008 SQL in the near future.

2009-02-23

1,567 reads

Networking - Part 4

You may want to read Part 1 , Part 2 , and Part 3 before continuing. This time around I'd like to talk about social networking. We'll start with social networking. Facebook, MySpace, and Twitter are all good examples of using technology to let...

2009-02-17

1,530 reads

Speaking at Community Events - More Thoughts

Last week I posted Speaking at Community Events - Time to Raise the Bar?, a first cut at talking about to what degree we should require experience for speakers at events like SQLSaturday as well as when it might be appropriate to add additional focus/limitations on the presentations that are accepted. I've got a few more thoughts on the topic this week, and I look forward to your comments.

2009-02-13

360 reads