Stefan Steiniger
unread,Oct 12, 2017, 9:38:01 AM10/12/17Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to fabriziogrieco, ojhora...@googlegroups.com
Hi Fabrizio (I cc this to the google user list - if you don't mind),
Ok so I checked with the data and your guess is correct. The reason why
LSCV is not working is that the dataset contains observation points that
are at the extact same position. I think the reason is that in LSCV
point-to-point distances are calculated/evaluated and when these are
zero, then the math may be screwed up. Weird that I did not correct for
it (and I am not sure if I find time, as I don't have everything set up
at the moment to do bug fixes).
Anyway, so when I used the function Movean > HRE > Point KDE > "Display
LSCV Function ..." for the individual 2 dataset, then I see that the
curve isn't a "good shaped" curve (going upwards, a bit like an r, with
the lowest value to the left side). The h_opt value for the biweight
kernel is given with 3.8m, i.e. approx. 4 meters. This value is actually
smaller than the grid size of 10m that I specified, and it may be that
the error you received of not having a point is misleading here, i.e.
that the problem is actually h=4m < grid size=10m.
So anyway I then delete the points that are on top of each other using
the function Tools > QA > "Delete Duplicate Geometries..." (leaving the
"delete only if attributes are the same" unchecked) - which reduces in
the case of individual 2 the observation points from 44 to 32.
Displaying the curve again looks now better (its now having an L shape,
with the highest value to the left) and gives me an h_opt for the
biweight kernel with 196m (so: 4m vs 196). If I subsequently execute
Point KDE with LSCV option, then it does work for individual 2.
Now to more comments:
- To delete the observations that are at the same position isn't a very
good idea, because one removes information and the KDE surface will also
look different. Best probably would be to write a "merge points
function", which increases the weight based on how many points are
merged. The other option is to displace the overlapping points by a
little amount. But for that there is no function in OpenJUMP either,
that I am aware off. So the only way would be to do that manually by
making the layer editable and moving/displacing one of the two
overlapping points by a "small distance". (actually QGIS may have such a
function, but I am not sure if this can be applied to the dataset itself
or is only for solving rendering/display problems)
- The explode function I was referring to does not help, as all points,
in your case, where points - without any multi-points. That is why I
think that the error message "no point dataset" is actually misleading,
because it is a pure single point dataset.
Let me know if you have further questions, problems, etc.
Stefan
On 10/10/17 16:36, fabriziogrieco wrote:
> Hi Stefan,
>
> I could not find an "explode" option anywhere; I am sending you a file
> that contains two individuals, marked with the variable "ind" with
> values 2 and 4. Once I extract the layers based on "ind", I can make a
> LSCV raster for 4, not for 2. I am pretty sure that it also did work
> with some layers with points in the same locations, but for some
> reason it does no work in others, like 2.
>
> Both layers 2 and 4 are marked with the icon "..." at the top, I see
> no difference.
>
> Thanks a lot for your time!
>
> Best regards
> Fabrizio
>
>
>
> Stefan Steiniger schreef op 10/10/2017 17:06:
>> Hi Francisco,
>>
>> interesting observation - it could be the reason. It could be that the
>> CSV importer generates a multi-point if there points at the same
>> location. You could see if the the dataset is of type geometry "point"
>> in the very very first column of the attribute table (there is an
>> image/icon) before the FID column. Or you use the tool Edit > Extract
>> > Extract Layers by Geometry type... and then you see what layers it
>> generates.
>>
>> If you actually have a multipoint, then you can either delete it
>> (perhaps not so good idea) or "explode it" into single points
>> (function is available from the mouse click menu on that particular
>> multi-point, when the layer is editable).
>>
>> but if you want, you could also send me a dataset where LSCV does not
>> work and I could have a look at it.
>>
>> cheers,
>> Stefan
>>
>> PS: As you seem to be into birds: I was lucky the weekend and saw a
>> family of condors! :)
>>
>>
>> On 10/9/17 05:25, fabriziogrieco wrote:
>>> Hi Stefan,
>>>
>>> thanks again for you reply. At some point I gave up, and let this
>>> aside for a while. After all, it was meant for making a picture for
>>> a manuscript.
>>>
>>> Actually I have seen another issue: when doing the LSCV kernel
>>> estimation, I often (not always) get a message "no point dataset".
>>> Other times (for other layers) it works ok. I am wondering why some
>>> layers are ok and others give this message. They all come from
>>> extracting layers from a CSV file based on a grouping variable
>>> "INDIVIDUAL", so they are equivalent, only the number of points
>>> changes. I note that the error message occurs when the layer
>>> contains points with the same coordinates, for example 1000, 2000
>>> and then another point with 1000, 2000. Could it be the reason?
>>>
>>> Thanks
>>>
>>> greetings
>>> Fabrizio
>>>
>>>