Creating my own Map Shapefiles for Power BI

(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!

Comments