<html>
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<p>Hi Edwin,</p>
<p>That's a cryptic error message, but it sounds like the <tt>writeOGR()</tt>
function from rgdal (which is called by <tt>lhs.exp.shp()</tt>)
is failing to export one or more of the objects in your
lochoh-hullset object (i.e., either a hull or isopleth). I'm not
familiar enough with rgdal to interpret the message, but I've
heard of other cases where there's something funny about a polygon
(e.g., very complex geometry, nodes on top of each other,
overlapping subpolygons, teeny tiny slivers, null attribute
values, etc.) that the gdal library (which is written in C++ I
believe) can not handle. Or it could be something the shapefile
file format can't handle.</p>
<p>There are a couple of things you could try. You could use the <tt>hulls
= FALSE</tt> or <tt>iso = FALSE</tt> arguments in <tt>lhs.exp.shp()</tt>
function, to determine whether it is a hull or an isopleth that is
causing the problem. Line 2 of the traceback suggests that it's
struggling with one of the isopleths.</p>
<p>The <tt>isopleths()</tt> function in tlocoh returns the
isopleths in a locoh-hullset as a list of SpatialPolygonDataFrame
objects (which you can also grab directly with an expression). The
SpatialPolygonDataFrame class is probably the most common data
class in R for polygon layers, so you could try to export them to
disk using a different package. For example the maptools package
has a function called <tt>writeSpatialShape()</tt>, the spsurvey
package has a function called <tt>sp2shape()</tt>. You could also
export the SpatialPolygonDataFrame to a different format that your
GIS can read, such as kml. For a list of all the export drivers
the rgdal package supports, run <tt>ogrDrivers()</tt>.</p>
<p>If none of these work, you could track down what is causing the
error through a process of elimination (e.g., export the polygons
in the isopleths SPDF one-by-one). <br>
</p>
<p>This is a very rare error so I don't suspect there is something
fundamentally wrong with the data structure or the way the
isopleths are created, but if you can isolate what it is about the
polygon that is causing the error and we can trap it that would be
a good feature to add. If you want to explore that more send me an
email (no need to cc the entire list). <br>
</p>
<p>Hope this helps.</p>
<p>Andy<br>
</p>
<p><br>
</p>
<br>
<div class="moz-cite-prefix">On 7/21/2016 1:20 AM, Parker, Edwin
wrote:<br>
</div>
<blockquote
cite="mid:C835AE13-F230-4FFB-A95F-4CEB9161E2D6@2015.ljmu.ac.uk"
type="cite">
<pre wrap="">Hello,
I am still fairly new to the T-LoCoH package but have been using it so far without any problems (and think it’s great!). However, I am recently getting the following error message when trying to export a locoh.lhs object as a shapefile:
*** caught segfault ***
address 0x0, cause 'memory not mapped'
Traceback:
1: .Call("OGR_write", pre, PACKAGE = "rgdal")
2: rgdal::writeOGR(hs[[hs.name]][["isos"]][[iidx]][["polys"]][hs[[hs.name]][["isos"]][[iidx]][["polys<a class="moz-txt-link-rfc2396E" href="mailto:]]@plotOrder,],dsn=dirname(fn.shp.unique.str),layer=basename(fn.shp.unique.str),driver=">"]]@plotOrder, ], dsn = dirname(fn.shp.unique.str), layer = basename(fn.shp.unique.str), driver = "</a>ESRI Shapefile")
3: lhs.exp.shp(data.lhs, id = NULL, k = NULL, r = NULL, a = NULL, s = NULL, hs.names = NULL, hpp = FALSE, hulls = T, iso = T, iso.idx = NULL, iso.metric = NULL, ellipses = FALSE, dr = FALSE, dr.idx = NULL, allpts = FALSE, nn = FALSE, dir = ".", file.base = "", file.base.auto = TRUE, avl.file = NULL, status = TRUE, show.time = TRUE, hm = "all", anv = NULL, hsp = NULL, metadata = TRUE)
Possible actions:
1: abort (with core dump, if enabled)
2: normal R exit
3: exit R without saving workspace
4: exit R saving workspace
Selection:
I was wondering if anyone had any ideas what is going wrong as I have exported lhs objects as shapefiles before without any problems. Using R 3.3.1 and t-locoh 1.40.01. Also tried reinstalling R and t-locoh but still get the same message.
Many thanks,
Ed Parker
________________________________
Important Notice: the information in this email and any attachments is for the sole use of the intended recipient(s). If you are not an intended recipient, or a person responsible for delivering it to an intended recipient, you should delete it from your system immediately without disclosing its contents elsewhere and advise the sender by returning the email or by telephoning a number contained in the body of the email. No responsibility is accepted for loss or damage arising from viruses or changes made to this message after it was sent. The views contained in this email are those of the author and not necessarily those of Liverpool John Moores University.
_______________________________________________
Tlocoh-info mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Tlocoh-info@lists.r-forge.r-project.org">Tlocoh-info@lists.r-forge.r-project.org</a>
<a class="moz-txt-link-freetext" href="http://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/tlocoh-info">http://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/tlocoh-info</a>
</pre>
</blockquote>
<br>
<div class="moz-signature">-- <br>
<font face="Times New Roman, Times, serif">
<strong>T-LoCoH</strong>: A hull-based method for home range
construction and spatiotemporal analysis of movement data.<br>
Lyons, A., Turner, W.C., and WM Getz. 2013. Home Range Plus: A
Space-Time Characterization of Movement Over Real Landscapes. <a
href="http://www.movementecologyjournal.com/content/1/1/2">BMC
Movement Ecology 1:2</a>.<br>
<a href="http://tlocoh.r-forge.r-project.org">http://tlocoh.r-forge.r-project.org</a><br>
</font><br>
</div>
</body>
</html>