ctmm-initiative / ctmmweb

Web app for analyzing animal tracking data, built upon ctmm R package
http://biology.umd.edu/movement.html
GNU General Public License v3.0
32 stars 21 forks source link

Shapefile Export fails with multiple models selected #32

Closed regan-sarwas closed 7 years ago

regan-sarwas commented 7 years ago

Stack trace on console:

Warning: Error in rgdal::writeOGR: layer exists, use a new layer name
Stack trace (innermost first):
    57: rgdal::writeOGR
    56: writeShapefile.UD
    55: writeShapefile
    54: FUN [/Users/regan_sarwas/MyForks/ctmm-webapp/server.R#1562]
    53: lapply
    52: write_f [/Users/regan_sarwas/MyForks/ctmm-webapp/server.R#1561]
    51: build_zip [helpers.R#611]
    50: download$func [/Users/regan_sarwas/MyForks/ctmm-webapp/server.R#1569]
     1: runApp
Error : layer exists, use a new layer name

Steps to reproduce:

  1. open hosted app (stack trace is from 18a6b21a2a8c2cf469df22fdda43648fed60e1ed)
  2. Select Use Sample of Buffalo Data
  3. Select Cilla
  4. Fit Model
  5. Select both OU anisotropic and OUF anisotropic models
  6. Preview 2 home range plots
  7. Click Export Shapefiles

Shapefile export works fine with multiple animals, just not multiple models per animal.

xhdong-umd commented 7 years ago

Thanks for the report! The code used individual name as shapefile name. I have updated it to include the model name and tested it works.

regan-sarwas commented 7 years ago

@xhdong-umd, Thanks for the speedy fix. It works great.