Error when executing 'Points in Polygon' data function

Error when executing 'Points in Polygon' data function

book

Article ID: KB0073940

calendar_today

Updated On:

Products Versions
Spotfire Desktop -
TIBCO Cloud Spotfire -

Description

When executing the 'Points in Polygon' data function the following error is returned:

TIBCO Enterprise Runtime for R returned an error:

The data function 'Points in Polygons for Longitude-Latitude Coordinates (Points in Polygons for Longitude-Latitude Coordinates)' could not be executed.

Error in:

validObject(res) :
invalid class "SpatialPolygons"
object: non-unique Polygons ID slot values    
eval(script, envir = .GlobalEnv)    
eval(script,envir = .GlobalEnv)    
withCallingHandlers({    readWKB(Geometry, Id, proj4string = CRS("+proj=longlat +datum=WGS84"))  
SpatialPolygons(obj, proj4string = proj4string)    
validObject(res)    
stop(paste("invalid class \"", Class, "\" object: ", msgs))

Issue/Introduction

Getting "The data function 'Points in Polygons for Longitude-Latitude Coordinates (Points in Polygons for Longitude-Latitude Coordinates)' could not be executed." error

Resolution

The line:

object: non-unique Polygons ID slot values

indicates that there are duplicate entries in the ID column used as an input parameter into the data function.  Remove any duplicate entries to correct this error.