MapReveal™ Software

 View Only

Performing Spatial Joins and calculating Summaries in MapReveal™ Software

  • 1.  Performing Spatial Joins and calculating Summaries in MapReveal™ Software

    Employee
    Posted 12-27-2023 07:48

    Welcome to another MapReveal™ Software Community Post!

    A key utility of GIS applications is the ability to perform Spatial Joins – transferring attributes from one layer to another based on the spatial relationships between their features. In this post, I want to show you how you can perform spatial joins and calculate summaries for the joined attributes in MapReveal.

    For this example, I will be using two datasets: the Pincode boundaries for Mumbai city area and the Restaurant POIs for the same area with attributes like the average Cost for Two and customer ratings. My objectives are as follows:

    • Find the count of restaurants in each pincode
    • Find the average Cost for Two in each pincode

    For this, I have created a Map Session with the relevant datasets. Let us take a look at the data. First, I have the pincode boundaries for Mumbai city area.

    I have a sample Restaurants dataset for the same area which contains about 3660 point features. The 'avg_cost_for_two' is my attribute of interest for this example.

    Next, in order to achieve my objectives, I can utilize the 'Spatial Join' tool available within the Vector Processing tools.

    Next, I can specify the following parameters:

    • Input Layer: The Vector layer containing the input features ('Mumbai_pincodes')
    • Join Layer: The Vector Layer containing the features I want to join/summarize ('Mumbai_restaurants')
    • Relationship Type: The spatial relationship between the features from the Input and Join layers.
    • Summary: This option can be used to generate summaries for the feature attributes that I want to join. If left unchecked, the tool will perform the spatial join without calculating any summaries.

    I can then click on the 'Next' button which will take me to the following screen where I can select the attributes/fields of interest from the 'Fields to Summarize' dropdown.

    I am going to select the 'Name' field which I can use to generate the count of features falling within each pincode, and the 'Avg_cost_for_two' to calculate the mean value of those features.

    Once the fields are selected, I can then specify the summary(s) that I want to calculate on each field using the dropdown(s) available in the 'Summaries to Calculate' section.

    You will notice here that the 'Select Summaries' dropdown shows different values based on the type of the attribute selected. Since 'Name' is a categorical variable, it shows the following summaries.

    While for 'avg_cost_for_two' being a numerical variable, the following statistical summaries are shown. You may select more than one option depending upon your use case requirements.

    Once I have specified the parameters, I can 'Run' the tool. I can then provide the Output Layer Name in the next step which will save the output and create a new layer within the same Map Session.

    Now, let's look at the table of the output file.

    As shown in the snapshot above, two additional fields – 'name_count' and 'avg_cost_for_two_mean' – have been created showing the count and average cost of restaurants within that pincode.

    I can then quickly create a theme using graduated styling on the 'avg_cost_for_two_mean' field and show the 'name_count' as labels.

    Using the identify tool, I can inspect/visualize the summaries that I just created.

    I hope you found this useful. Do share your feedback/questions in the comments section.



    ------------------------------
    Anurag Hazarika
    Product Manager
    Precisely | Trust in Data
    ------------------------------