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

The Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.

Reply
MKingdon
New Member

Adding georeferenced photos to map / PDF / AutoCAD drawings

Hi all,

 

I work at an engineering company.  I am looking for a workflow where I can load georeferenced photos (photos taken on a phone with GPS data) and load them onto a map / site plan.  The goal is to make an interactive map where anyone can view the map, see icons showing the location of each georeferenced photos and click that icon to load the photo.

 

The map should be easy to access, via a weblink on SharePoint or similar.  Is this possible with PowerBI?

 

Thanks,

 

Mike

1 ACCEPTED SOLUTION
OwenAuger
Super User
Super User

Hi @MKingdon 

Just adding to @tharunkumarRTK 's answer, in casea you are still looking at this.

 

I have been experimenting with a Power BI model/report that takes a folder of JPG files (each of which should have EXIF GPS tags), and uses Power Query to:

  • Extract the latitude/longitude values
  • Load the image data in Base64 format.

My PBIX and some test images are attached in a ZIP file.

 

In order to work, this does require images to be not too large (my estimate is up to 1.5 MB but will require some testing), since each image is represented using Base64 text and there are limits to the size of the text value that represents the image in the report. During testing, I had to reduce the size of some images to make it work.

 

If you want to use external URLs for images, they generally need to be anonymously accessible, which can be a problem if the images are sensitive.

 

I have attached my working PBIX in case it's of use to you.

  1. The PBIX is pre-loaded with some test images (photos of various cities).
  2. You can change the Folder parameter to your own folder containing geotagged JPGs and refresh (Transform Data > Edit Parameters).
  3. The model contains two tables (extracts shown below):
    1. Image: One row per image containing ID, filename & lat/long.
    2. Image Data: Contains JPG data for each image split across rows in Base64 format.
  4. The two key functions in Power Query which you should take a look at are:
    1. fnJpgGPS: Takes JPEG binary data as an argument and returns a record in the form [Latitude = LatitudeDecimal, Longitude = LongitudeDecimal]
    2. fnJpgSpliBase64: Takes JPEG binary data and "size" as arguments, and returns a table with the Base64 representation of the file split across indexed rows. Size should be at most around 30,000 (see this blog post from Chris Webb).
  5. These functions are used to generate the Image & Image Data tables.
  6. You can then use various map visuals to plot the locations, and visuals such as HTML Content or HTML Content (lite) to display the images themselves. A sample report page with a map and a Card (new) visual is shown below.

 

Folder parameterFolder parameter

 

 

Image tableImage table

Image DataImage Data

 map-image.gif

 

If you need to customize the basemap itself, I'm sure this is possible with Icon Map or other visuals, though I haven't tried it yet.

 

 

Hope this is of some use!


Owen Auger
Did I answer your question? Mark my post as a solution!
Blog
Twitter
LinkedIn

View solution in original post

(Virus scan in progress ...)
3 REPLIES 3
OwenAuger
Super User
Super User

Hi @MKingdon 

Just adding to @tharunkumarRTK 's answer, in casea you are still looking at this.

 

I have been experimenting with a Power BI model/report that takes a folder of JPG files (each of which should have EXIF GPS tags), and uses Power Query to:

  • Extract the latitude/longitude values
  • Load the image data in Base64 format.

My PBIX and some test images are attached in a ZIP file.

 

In order to work, this does require images to be not too large (my estimate is up to 1.5 MB but will require some testing), since each image is represented using Base64 text and there are limits to the size of the text value that represents the image in the report. During testing, I had to reduce the size of some images to make it work.

 

If you want to use external URLs for images, they generally need to be anonymously accessible, which can be a problem if the images are sensitive.

 

I have attached my working PBIX in case it's of use to you.

  1. The PBIX is pre-loaded with some test images (photos of various cities).
  2. You can change the Folder parameter to your own folder containing geotagged JPGs and refresh (Transform Data > Edit Parameters).
  3. The model contains two tables (extracts shown below):
    1. Image: One row per image containing ID, filename & lat/long.
    2. Image Data: Contains JPG data for each image split across rows in Base64 format.
  4. The two key functions in Power Query which you should take a look at are:
    1. fnJpgGPS: Takes JPEG binary data as an argument and returns a record in the form [Latitude = LatitudeDecimal, Longitude = LongitudeDecimal]
    2. fnJpgSpliBase64: Takes JPEG binary data and "size" as arguments, and returns a table with the Base64 representation of the file split across indexed rows. Size should be at most around 30,000 (see this blog post from Chris Webb).
  5. These functions are used to generate the Image & Image Data tables.
  6. You can then use various map visuals to plot the locations, and visuals such as HTML Content or HTML Content (lite) to display the images themselves. A sample report page with a map and a Card (new) visual is shown below.

 

Folder parameterFolder parameter

 

 

Image tableImage table

Image DataImage Data

 map-image.gif

 

If you need to customize the basemap itself, I'm sure this is possible with Icon Map or other visuals, though I haven't tried it yet.

 

 

Hope this is of some use!


Owen Auger
Did I answer your question? Mark my post as a solution!
Blog
Twitter
LinkedIn
(Virus scan in progress ...)
v-xinc-msft
Community Support
Community Support

Hi @MKingdon ,

Did the reply tharunkumarRTK offered help you solve the problem, if it helps, you can consider to accept it as a solution so that more user can refer to, or if you have other problems, you can offer some information so that can provide more suggestion for you.

Best regards,

Lucy Chen

tharunkumarRTK
Super User
Super User

@MKingdon 

I would suggest you to save all your images in a storage folder (for example sharepoint folder). We would need some identifier to identify the geo location of each image, so my recommendation is put the image name as the respective latitude and longitude. Load those images and their names (Image URL or binary code of the images) into Power BI. Map. Then you will be able to plot the locations with the latitude and longitude data. 

 

After that in a new page, add a table and put the image URL column (Do not forget to categorize the image column as Image URL column). Then convert this page as drill through page and put the latitude and longitude fields as drill through fields. 

 

This way you will be able to create a map visual in Power Bi and your end users can see the image when they right click on drill through on a specific location. 

 

If you want your user to see the image when they hover over a location then instead of making it as drill through page you can set it as tooltip page.

 

Need a Power BI Consultation? Hire me on Upwork

 

 

 

Connect on LinkedIn

 

 

 








Did I answer your question? Mark my post as a solution!
If I helped you, click on the Thumbs Up to give Kudos.

Proud to be a Super User!


PBI_SuperUser_Rank@2x.png

Helpful resources

Announcements