Forum Discussion

Petr_Durana's avatar
Petr_Durana
Frequent Visitor
2 years ago
Solved

Using a custom "map" for Shape Map

Hello, I have this SVG file which is a basketball backboard divided into individual sectors. I have a set of shot data, for each shot the x and y coordinates and whether the shot was converte...
  • Petr_Durana's avatar
    2 years ago

    My solution to find out which sector the shot belongs to. There are many methods to find out if a certain point is in a certain polygon, but all methods do not guarantee the correct result and are very demanding on the computational algorithm. So I chose the "brute force" method:
    I gave the artificial intelligence (ChatGPT) an image of the sectors on the board (see initial post above) and instructed it to export the coordinates of each point and the color at that point. For the exported 411,651 points πŸ™‚ I changed the color number to the sector number and inserted the resulting table (x, y, id) into the project.
    With a simple DAX formula, I can find the sector id for the given x and y coordinates of the shot and that's what I needed. The result is shown in the figure, where the color of the sector is determined by the %FG (percentage of shot success) value from 0 (dark red) to 100 (light green).