Tableau BUFFER functions - a complete TUTORIAL on using buffers for spatial analysis

Sdílet
Vložit
  • čas přidán 3. 08. 2024
  • In this in-depth tutorial I walk through how to use various Tableau spatial functions (Buffer, MakePoint, Distance) as part of an interactive geospatial analysis to determine how many Airbnbs there are within 500 metres of EV charging points in London.
    💾 Data sources
    Airbnb data: insideairbnb.com/get-the-data....
    Charging points: data.gov.uk/dataset/1ce239a6-...
    📊 Interact with and download a complete dashboard with more functionality: tabsoft.co/3sHLdMh
    📑 Blog post: Geospatial Analysis with Map Layers: bit.ly/313eBV0
    🗺 If you're new to Tableau map layers, you may want to watch this introductory video first:
    • Tableau Map Layers - a...
    📌 Chapters
    00:00 - Introduction - Using buffers for interactive spatial analysis
    00:22 - Data sources used
    00:41 - Connect to Airbnb data
    00:59 - MakePoint function to create Airbnb points
    01:46 - Connect to Charging Point data
    02:57 - Add Charging Point data as a second connection
    03:14 - Create a spatial join using join calculations
    04:22 - Explanation of spatial joins with buffers and points
    05:30 - Add charging points to the view as a new marks layer
    06:11 - Radial select tool to confirm distance of points
    06:30 - Add a filter to reduce the number of marks
    06:55 - Use the Distance function to show the distance in the tooltips
    07:37 - Add Buffers to the view as a marks layer
    08:10 - Re-order the map layers by drag and drop
    08:19 - Change aggregation of Distance to Min
    09:02 - Updating the join calculation to change the buffer size
    10:22 - Make buffers dynamic with a parameter
    11:11 - Create an in-range calculation to format Airbnb points
    11:59 - View underlying data for two points
    13:01 - Calculate the total Airbnbs in range of charging point
    14:41 - More developed example with additional features
    🔗 Social Media Links
    Blog: datavis.blog ➝ Tableau tips and tutorials
    Twitter: / datavisblog
    Portfolio: public.tableau.com/app/profil...
    LinkedIn: / marcreiduk
    ▶ Subscribe for the latest tips and tutorials: bit.ly/TableauTutorials
    #tableau #buffer #tutorial

Komentáře • 47

  • @premgct87
    @premgct87 Před měsícem

    Simply amazing on how you start telling the story.

    • @MarcReid
      @MarcReid  Před měsícem

      Thanks! Glad it was useful.

  • @ragragrec1
    @ragragrec1 Před 2 měsíci +1

    Amazing tutorial - shows the right mind can extract the best from tableau!

  • @gxsoft
    @gxsoft Před 2 lety +2

    Thanks Marc,
    I enjoyed your video and ideas.
    Very nice!
    gab
    Rio Cuarto, Argentina

  • @jusjerm
    @jusjerm Před 2 lety +2

    Unreal, I need to do this exact project tonight. Thank you for such a fantastic overview.

    • @MarcReid
      @MarcReid  Před 2 lety +1

      You're welcome! Happy to hear it was useful.

  • @MeghanaDoshi
    @MeghanaDoshi Před 3 měsíci

    Hi Marc,
    thanks for the informative video, it is really helpful. I have used the above for creating a geo map between Members and Zip Codes. We generally host events at specific Zip codes and hence need to find out members which reside within 5/10/20 mile radius of that Zip code .
    I have created the join using the below
    I have two data sources : Member and Zip Code
    Columns in Zip Code dataset include : First5 (which are the Zip Codes), Zip5 latitude, Zip5 longitude .
    Columns in Member include : Member Id, Mem_lat, Mem_long, Zip5 latitude, Zip5 longitude, First5 .
    inorder to find members within a specific radius i have used both the tables by joining them using :
    i used the below in the member table-
    Makepoint( Mem_latitude,Mem_longitude)
    intersects
    i used the below in the Zip Code table-
    BUFFER(MAKEPOINT([Latitude],[Longitude]),5,"miles")
    After which , i used right join , in order to ensure that in my geo map, I get both :
    Members in range
    Members out of range
    However , in the geo map when I add members IN range + Out range , there is difference of around 40 members.Please can you help me with it

    • @MarcReid
      @MarcReid  Před 3 měsíci

      Hi - It's quite difficult to debug that kind of issue here in the comments. I'd recommend posting on the Tableau Forums where you can also upload your workbook as it will be much easier for someone to diagnose. Thanks. community.tableau.com/s/explore-forums

  • @hernando313
    @hernando313 Před rokem

    It's amazing, thanks a lot. I am studing this topic for my Master of Science.

    • @MarcReid
      @MarcReid  Před rokem

      Awesome! Great to hear. Thanks.

  • @adolfohc78
    @adolfohc78 Před 10 měsíci +1

    Hi Marc, big fan here, your mapping tutorials have been a huge help for a project I'm working on, thanks!
    Quick question, at the beginning you joined both datasets using intersect and an inner join, this join returned all the points inside the buffer but in my application I need to see the points inside and outside the buffer, how can I do that?
    Thanks! 🙏🏼

    • @MarcReid
      @MarcReid  Před 10 měsíci

      Hi Adolfo - thanks for the kind words. You should be able to use an outer (or right) join to include those points that don't intersect. If you still see issues, I'd recommend posting on the forums along with your workbook so someone can take a closer look. Hope that helps.

  • @user-jl6nl3lx4o
    @user-jl6nl3lx4o Před 4 měsíci

    Thanks for the video Marc. I learned a lot from your video and I used it for one of my projects. Everything works well except sometimes when buffers overlap and distance parameter is less than maximum value Tableau does not color buffers correctly. For some buffers the distance is clearly less than chosen parameter value but it colors gray (false). Seems like Tableau is picking the distance from other overlapping point. But when use a table view, the distances and true false conditions are correct. I tried to use different LODs to color correctly all points within all overlapping bufferes but no luck. Do you know what could be the issue? I think it might be Tableau glitch. Thanks.

  • @Nicccy10400
    @Nicccy10400 Před 7 měsíci +1

    Hi Marc, great video. Really appreciate this!! Im wondering how to do this exercise if the two datasets are already in one reference excel file. For example, if ev charging points data and airbnb data are stacked in 1 excel. I attempted this by creating new calculation field and was able to get ev charging location and airbnb location ok (using if function to slice the data) but i was not able to get the distance function to output anything. The distance function calculation was valid but it doesnt show anything. I think the problem is I did not join anything at all (your case, you had to join the data from two files or table and chose intersect and so on). For my data, there isnt anything to join at the datasource level. Is there a way to join the data at the field level? Sorry for bombarding you with this but please help a lad out. Thank you!

    • @MarcReid
      @MarcReid  Před 7 měsíci

      Hi Nicccy - yes, you need two sources to make the join. Can you separate the data out into two separate sources? If not, you could duplicate the source - connect to it twice - and filter each source to the relevant data then make the join. Hope that helps.

  • @lizgonzalez1706
    @lizgonzalez1706 Před 2 lety

    Hello, an amazing tutorial thank you so much!, I just have a question, hope you can help me 🙌, how can I change the distance (buffer calculation) of some selected point in the map and keep that distance even if it is unselected? I am trying to have different distances in the same visualization

    • @MarcReid
      @MarcReid  Před 2 lety

      Hi Liz, thanks for the feedback. If I understand your requirement correctly, it's not really possible to have a dynamic size per buffer without having a parameter for every row and conditional statements in the buffer calc. You could make the buffers different sizes by including a buffer size column in your data and then referring to that field in the buffer calc. Hope that helps.

  • @bartyl40
    @bartyl40 Před 9 měsíci +1

    Hi Marc, thanks a lot for this video! I have a question, if I want to see how many Airbnbs are in a buffer around other Airbnb (skipping the part with EV stations). Do I need to duplicate the source and join them with Intersects or is there simpler solution?

    • @MarcReid
      @MarcReid  Před 9 měsíci

      Hi - yes, I think a self join would be the way to go. Essentially it's a row level calculation so both points to be on the same row.

    • @markusk4527
      @markusk4527 Před 4 měsíci

      @MarcReid Thank you very much for this tutorial, although it has been online a while, it is extremely helpful. And this comment is extremely important, because I got the impression from other tutorials that it is possible do to these calculations with different rows. However, I tried to check if there is any point within a (rather large) series of overlapping buffers and failed. Due to the multiplication in the intersects this seems to be tricky, because every buffer have true and false intersects. Has anyone an idea how I can identify the buffers with no points within a defined range?

  • @TomS-2024
    @TomS-2024 Před 4 měsíci

    Thanks Marc. This is really helpful. I have the same issue that @roiargaman850 raised a year ago. The In Range calculation does not color points correctly if distance parameter value is less than maximum available value. When parameter is at maximum everything works perfectly. However, when parameter value is less than maximum some points are not being colored correctly. For example, I can clearly see some points are within range of buffer 1 but colored gray because, for some reason, the distance is calculated from buffer 2, which is further away and that's why it's being colored gray. I know some people raised this question a while ago. I wonder if you heard any resolution to this issue. Thanks again for the excellent tutorial!

    • @MarcReid
      @MarcReid  Před 4 měsíci

      Hi Tom, it's difficult to debug these kinds of issues here. I'd recommend posting on the Tableau forums and attaching a packaged workbook. It will be easier for someone to explore the issue in detail. Thanks. community.tableau.com/s/explore-forums

  • @zelinka852
    @zelinka852 Před rokem

    Marc, this is amazing, thx! It works great except for some performance issues: We are searching for gastronomy from OpenStreetMap in 500 m radius of Airbnbs & every query takes forever to load. Do you have some tips for us to make our dashboard more presentable? Greetings from Berlin

    • @MarcReid
      @MarcReid  Před rokem +1

      Hi - thanks for the feedback. Spatial joins can be slow if you're working with a lot of data especially if points are contained within multiple buffers as you are then creating multiple rows for each point. If you can pre-filter that data that would help. For further help it's best to post a workbook on the Tableau forums where someone can then take a look.

  • @scottgill1515
    @scottgill1515 Před 11 měsíci

    Hey Marc! This video is seriously the most helpful and informative tutorial I've ever come across, so I seriously appreciate it! Quick question in my case is that for my "In Range" calculation, my "AirBnB" locations are currently showing up as both true and false for in range and I can't figure out why. Any ideas?

    • @MarcReid
      @MarcReid  Před 11 měsíci

      Hi Scott, thanks for the kind words - much appreciated. It will depend on your data and how you've configured the join (inner, left, outer), but if a point meets the join criteria for multiple buffers, you'll get multiple rows. To ensure the True rows are on top, you might need to reorder the values in the colour legend (top right in the video), you can click and drag them. Hope that helps. If not, the best thing to do is open a case on the Tableau forums so the workbook can be shared (community.tableau.com/s/explore-forums), there's generally a very quick response.

    • @scottgill1515
      @scottgill1515 Před 11 měsíci +1

      @@MarcReid Thanks for the quick response man, made me an instant subscriber. Yeah I'd suspect something must be going on with my joins. When I make the "In Range" field a filter and have it set to true, the color's reflect appropriately along with the accurate distances being displayed. However, when I set it to All, the distances get really wonky and begin to calculate for other locations rather than the one it's "within range" of I'm guessing. I'll go ahead and try to switch away from an inner join if that works.
      What do you mean by "To ensure the True rows are on top, you might need to reorder the values in the colour legend (top right in the video), you can click and drag them"? in case you have another moment?

    • @MarcReid
      @MarcReid  Před 11 měsíci

      ​@@scottgill1515- the odd numbers you are seeing might be the aggregation of values for the dupe rows. (see this timestamp for more: czcams.com/video/pqb6RMGFVl0/video.htmlsi=5RNz5uDjy1R-aIlg&t=500). re the colour reordering, if you have one point in range of one buffer but out of range of a second buffer (true and false), those two points will overlap on the map so you'll true or false on top depending on the z-order depending on how the colours are sorted, which you can change by dragging the colours in the legend to change. Hope that makes sense.

    • @scottgill1515
      @scottgill1515 Před 11 měsíci

      @@MarcReid You are the smartest man alive!! No fix needed with the join just needed to re-order the color legend like you suggested haha. Have no idea how you figured that out but it's awesome. I appreciate you so much!

    • @MarcReid
      @MarcReid  Před 11 měsíci +1

      @@scottgill1515 - 🙂 Happy to help.

  • @afunnykorean
    @afunnykorean Před 2 lety +1

    Hi Marc, This is incredible Thank you! Quick Question - If i want each buffer point to have its own individual radius, i.e. one is a 5 mile radius, 2nd is a 8 mile radius and the third a 12 mile radius.. Would something like this work?
    instead of this:
    BUFFER(MAKEPOINT([Latitude],[Longitude]),5,"miles")
    I could do:
    BUFFER(MAKEPOINT([Latitude],[Longitude]),[Column that has different numbers for each point],"miles")

    • @MarcReid
      @MarcReid  Před 2 lety +1

      Thanks, Scott. Glad it was useful. Yes, you could use that method to create different sized buffers.

    • @afunnykorean
      @afunnykorean Před 2 lety

      @@MarcReid Thank you! Looking forward to your future videos.

  • @yiranli2819
    @yiranli2819 Před 2 lety

    Hi Marc, when i bring in the second point data, there is an error message saying "fields can not be used from sheet because there is no relationship to the primary data source". Do you know how to fix this issue? Thank you!

    • @MarcReid
      @MarcReid  Před 2 lety

      Hi Yiran, it sounds like you are creating a blend rather than a join. Take a look at this help page on joining data: help.tableau.com/current/pro/desktop/en-us/joining_tables.htm#create-a-join

  • @alfredoiglesias7856
    @alfredoiglesias7856 Před 2 lety

    Thank you, Mark!
    Is it possible to have the longitude and latitude without exporting an Excel file?

    • @MarcReid
      @MarcReid  Před 2 lety

      Hi Alfredo, not sure I follow. I downloaded the airbnb locations from the site linked in the description. That's the only source I had for them

    • @alfredoiglesias7856
      @alfredoiglesias7856 Před 2 lety +1

      @@MarcReid Thank you for your response, Marc

  • @doitlikestengo
    @doitlikestengo Před 2 lety

    When applying the in range calculation, it shows me the total distances instead of the minimum distances again... resulting in every point being out of range. any idea why this might happen or what a solution could be?

    • @MarcReid
      @MarcReid  Před 2 lety

      It may be the aggregation of your calculation. See this part of the video for an explanation: czcams.com/video/pqb6RMGFVl0/video.html

  • @roiargaman850
    @roiargaman850 Před rokem

    Hi mark, I did everything as you did, but some points weren't quite right. If I have points that are located inside two buffers when the parameter is at the largest size (500 m), some of them do not show "in range" when the size is smaller (let's say 400 m). However, all of them are within one buffer (buffer 1).
    When I enlarge the parameter and those points get inside the two buffers, it works. Also when I look at the distance of one of those points, it's showing the distance from buffer 2 and not from buffer 1 which encomposes them. It appears that tableau does not know which points are linked to which buffers.

    • @MarcReid
      @MarcReid  Před rokem

      Hi - It's not totally clear to me the scenario you're explaining, however, if your point is within range of two buffers then the spatial join will result in two rows. You then need to determine which of those you want to use - for displaying the distance or whatever. If this doesn't help I'd recommend sharing your workbook on the Tableau forums for more specific help.

    • @roiargaman850
      @roiargaman850 Před rokem

      @@MarcReid Thanks for the reply, I will try to refine the case. A point that is closer to buffer 1 and is within its radius, is not considered part of buffer 1. For example: the condition I created as in your example "within range" does not show it as being within the range, and the distance actually refers to buffer 2, which is further away. As soon as I change the parameter and increase its radius to the maximum (I did as in your example - 500 m), and both buffers contain the point, then the data of the point correctly refers to the buffer closest to it - buffer 1.

    • @MarcReid
      @MarcReid  Před rokem +1

      @@roiargaman850 - I'd suggest making a post on the Tableau Forums where you can also upload your workbook as it will be much easier for someone to diagnose. Thanks. community.tableau.com/s/explore-forums

  • @koumospecial
    @koumospecial Před 2 lety

    Is this 2021.1 or 2021.4?……

    • @MarcReid
      @MarcReid  Před 2 lety +1

      I'm using 2021.4 in this video. But 2021.1 will also work fine.