Jump to content

Export Spatial Data To Shapefile


Tyler Kendle
Go to solution Solved by David Boot-Olazabal,

Recommended Posts

Hello everyone,

I'm looking for some help figuring out my error when I run the data function "Export to Shapefile" I downloaded from the Exchange page.  I watched the Dr. Spotfire video on this a few times but I'm unable to get the data function to work for me.  Any help would be much appreciated.

I installed the three packages required: "wkb", "rgdal", and "sp"

Error Details:
TIBCO Enterprise Runtime for R returned an error

The data function '[Geospatial] Export to Shapefile' could not be executed.

Error in writeOGR(obj = spdf, dsn = export_path, layer = export_layer : Spatial Polygons objects should have valid ordering comments
use rgeos::createSPComment()
    eval(script, envir = .GlobalEnv)
    eval(script, envir = .GlobalEnv)
    withCallingHandlers({
    writeOGR(obj = spdf, dsn = export_path, layer = export_layer,
    stop("Spatial Polygons objects should have valid ordering comments\nuse rgeos::createSPComment()")

Screenshot of spatial data trying to be exported:
image.png.68d66a8d821d15d6df68f01befbde1f1.png

Video:


Thank you,
Tyler

Link to comment
Share on other sites

  • Solution

Hi Tyler,

I was able to make it work, although the TERR code seems a bit outdated.
My initial mistake was that I did not create the export sub folder in the path. Have you configured the path and/or does the export sub folder exists?

The error shown above, might indicate you have to install the rgeos package as well. You may try that one as well.
Also, would it be possible to share your dxp file, so we can have a look at it? The included demo dxp in the Exchange package, does still work for us. So we're interested to see why your dxp is failing.

Kind regards,

David

Link to comment
Share on other sites

Hi David,
Thank you for your help, I installed the rgeos package and reran the data function.  I was able to export the shapefile successfully after that.  Thanks for the suggestion, that was what I was missing.

I appreciate all your help on this.

Thank you,
Tyler

  • Thanks 1
Link to comment
Share on other sites

  • 4 months later...

Hi,

rgdal has been retired by R, so this data function does not work for us any more. Is there an updated version using other R packages to achieve the same functionality?

 

Thanks!

Sasha

Link to comment
Share on other sites

Hi Gaia,

Thank you for your response! I struggle because many python libraries are not available for me. I am using our company's spotfire and installing a new python package on the company spotfire server takes a lot of process and time.  Our server does not have geopandas or spotfire_dsml but it does have R packages: terra and sf and sp and wkb. I am not very familiar with R. Is it possible to update the old R function with other R packages? Thank you so much!

 

Sasha

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...