Please download the Points in Polygons Data Function for Spotfire® from the exchange.
Details about the data function
Programming Language: TERR 6.0.3/R 4.3.1
Required R Packages: sp, wkb
Description: For each point in a table of locations defined by Latitude and Longitude coordinates, calculate which is its corresponding enclosing polygon from a separate table. Returns a column that contains the enclosing polygon identifier to append to the point location table.
Inputs:
- Geometry (Geometry column from shapefile table)
- ID (Identifier column from shapefile table)
- Longitude (Longitude column from point table)
- Latitude (Latitude column from point table)
Output:
- Id (column to append to the point table)
This dxp file illustrates this process using two tables:
- Point locations of some US airports
- State shapefiles
Example Input Table #1: Polygons: Shapefile with outlines of US States.
Example Input Table #2: Point data: Geographic locations of some US Airports.
Example Output: After running the TERR "Points in Polygons" data function, a new column named "Id" containing the state name identifier from the Shapefile is now present in the Airport Location table:
More Resources
- Use Geofencing to Select all Points within Polygons
- For an overall overview of the GeoAnalytics or Location Analytics capabilities of Spotfire please also review this page.
- Useful Geospatial Data Functions for Spotfire
- 1
Recommended Comments
There are no comments to display.