Converting Coordinates using TERR


I am trying to convert a set of coordinates from lat/long to UTM 13.  I have seen that this can be done in R with the use of the 'sp' and 'rgdal' packages.  I have tried to implement this in Spotfire with the following data function:

data = data.frame(lat,long)
coordinates(data) <- ~ lat + long
proj4string(data) <- CRS('+init=epsg:4326')
data.proj <- spTransform(data, CRS("+proj=utm +north +zone=13"))

My input parameters are columns containing latitude and longitude values.  This function works when I implement it in RStudio, but gives me the following error when I implement it in Spotfire:

TIBCO Enterprise Runtime for R returned an error: 'Error in CRS("+init=epsg:4326") : no system list, errno: 2
   at Spotfire.Dxp.Data.DataFunctions.Executors.LocalFunctionClient.OnExecuting(FunctionClient funcClient)
   at Spotfire.Dxp.Data.DataFunctions.Executors.AbstractFunctionClient.<RunFunction>d__0.MoveNext()
   at Spotfire.Dxp.Data.DataFunctions.Executors.SPlusFunctionExecutor.<ExecuteFunction>d__0.MoveNext()
   at Spotfire.Dxp.Data.DataFunctions.DataFunctionExecutorService.<ExecuteFunction>d__6.MoveNext()

Has anyone had any luck with converting coordinates in Spotfire?  I have successfully converted coordinates in Map Layers before, so I'm confused why this doesn't work??





1 Comment

Hi Tim

When you tested it in RStudio, were you running TERR or OS R?

Have you successfully used this function in TERR before to do coordinate conversion?


Lou Bajuk - May 25, 2016 - 2:29pm
+ Add a Comment

(2) Answers