Alteryx Essentials study materials
Alteryx Essentials study resources

Spatial Join Returns Nothing and the Map Is Empty

Alteryx Essentials · Put your knowledge to work in context.

All case studies

Spatial Join Returns Nothing and the Map Is Empty

An analyst has a point file of 12,000 store locations with latitude and longitude stored as strings in Lat and Lon columns (e.g., "40.7128", "-74.0060"). They also have a polygon file of sales territories in a .shp. The analyst uses Create Points with Lat and Lon, then a Spatial Join to assign each store to a territory. The Spatial Join returns zero matches, and the Map tool shows points clustered in the ocean off West Africa. The analyst is certain the coordinates are correct because they match a spreadsheet. The workflow needs to produce a store-to-territory mapping.

1. What is the most likely cause of points appearing off West Africa, and how do you correct it before re-running the spatial join?

Read the worked answer

Points clustered near (0,0) off West Africa almost always means the latitude and longitude were swapped, or one or both coordinates were read as zero/null. In Create Points, the X field is longitude and the Y field is latitude. If the analyst put Lat in X and Lon in Y, New York (40.7128, -74.0060) becomes X=40.7128, Y=-74.0060-a point off the coast of Africa. Also confirm the fields are numeric: if Lat/Lon were read as strings, Create Points may coerce them to 0, placing points at (0,0). Fix: use a Select or Formula to cast Lat and Lon to Double, then in Create Points set X = Lon and Y = Lat. Verify by checking a known point (e.g., a New York store should land near 40.7, -74.0) in a Browse or Map before the join. Only after the points are in the correct hemisphere should the Spatial Join be re-run.

2. After fixing the coordinates, the Spatial Join still returns fewer matches than expected-some stores near territory borders are unmatched. What explains this and how do you handle it?

Read the worked answer

Spatial Join matches on spatial relationship (e.g., point within polygon). Stores that fall exactly on a border, in a gap between territories, or slightly outside a polygon due to coordinate precision will not match an 'within' predicate. Options: (1) Use a 'nearest' or 'distance within' spatial match with a small tolerance (e.g., within 100 meters) as a fallback for unmatched points. (2) Check the polygon file's spatial reference and ensure it matches the points' spatial reference; a mismatch in projection can shift points relative to polygons. (3) Inspect the unmatched points on a map against the polygons to confirm they are genuinely outside territory boundaries (e.g., coastal stores, PO boxes). (4) Decide business rules for border cases: assign to the nearest territory centroid or flag for manual review. The output should include a match-status field so unmatched stores are visible rather than silently dropped, and the count of unmatched should be reconciled against the expected total.