[R-sig-Geo] adehabitat: Working with enfa() function using *asc files

2019-07-04 Thread ASANTOS via R-sig-Geo

Dear R-Sig-Geo Members,

?? Many years ago I used enfa() function of adehabitat package with my 
*asc files with environmental variables and my script works very well, 
but now adehabitat is deprecated and there are many versions of 
adehabitat. I install the adehabitatHS but for doesn't work with my *asc 
files.


?? My objective was create a data2enfa object and for this I used 
manually all the functions in an old adehabitat package (kasc2df, 
import.asc, as.kasc and data2enfa) but doesn't work too. In my script I 
make:


#Create enfa analysis object
pinkdata <- data2enfa(as.kasc(list(tmax=import.asc("tmax.asc") , 
tmin=import.asc("tmin.asc"))), pink.sub.pnt@coords)

#

??Error in count.points(pts, kasc) :
?? w should inherit the class SpatialPixels

?? I need to create a data2enfa object using *asc files as tab and 
organism position pink.sub.pnt@coords as pr in enfa1 <- 
enfa(dudi.pca(tab), pr,?? scannf = FALSE).


?? Please, any member that work with *asc files and ENFA help me?

Thanks in advanced,

Alexandre

--
==
Alexandre dos Santos
Proteo Florestal
IFMT - Instituto Federal de Educao, Ci??ncia e Tecnologia de Mato Grosso
Campus C??ceres
Caixa Postal 244
Avenida dos Ramires, s/n
Bairro: Distrito Industrial
C??ceres - MT  CEP: 78.200-000
Fone: (+55) 65 99686-6970 (VIVO) (+55) 65 3221-2674 (FIXO)

alexandre.san...@cas.ifmt.edu.br
Lattes: http://lattes.cnpq.br/1360403201088680
OrcID: orcid.org/-0001-8232-6722
Researchgate: www.researchgate.net/profile/Alexandre_Santos10
LinkedIn: br.linkedin.com/in/alexandre-dos-santos-87961635
Mendeley:www.mendeley.com/profiles/alexandre-dos-santos6/

___
R-sig-Geo mailing list
R-sig-Geo@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-geo


Re: [R-sig-Geo] How to reshape a LINESTRING sfc into equal length segments

2019-07-04 Thread Andrea Gilardi
Thank you very much for your answer. I tried to look into st_segmentize but
I don't think I can use it in this case (or I'm not able to). This is a
little example to show what I mean:

library(sf)
my_sf <- st_sf(a = c("1", "2"), geom = st_sfc(st_linestring(rbind(c(0, 0),
c(0, 1))), st_linestring(rbind(c(0, 1), c(1, 1, crs = 3003)

The sf object is formed by two touching linestring geometries of length 1m.
I would like to refactor the sf object into segments whose length is
approximately equal to 0.4m (I choose this value just for this example).
Since the two segments are touching each other, I'd like that the result
will be a new sf object with 5 geometries: 1) a linestring from (0, 0) to
(0, 0.4); 2) a linestring from (0, 0.4) to (0, 0.8); 3) a linestring from
(0, 0.8) to (0, 1) and from (0, 1) to (0.2, 1); 4) a linestring from (0.2,
1) to (0.6, 1) and 5) a linestring from (0.6, 1) to (1, 1).

Even if I use st_segmentize, the split of each segment does not consider
the neighbouring segments.

I'm sure that in a real dataset this is much more difficult and complicated
than this example since
1) it could happend that for one boundary point there are more than one
touching segments and
2) the total length of the network will never be an exact multiple of the
segment distance which implies that there will be some residuals
so, maybe, I'm just asking something unreasonable. I think that any
reasonable refactoring of the sfc of linestrings is fine for my
application.


Il giorno gio 4 lug 2019 alle ore 11:56 Edzer Pebesma <
edzer.pebe...@uni-muenster.de> ha scritto:

> You may want to look into sf::st_segmentize.
>
> On 7/3/19 10:58 AM, Andrea Gilardi wrote:
> > Hi everyone. This is my first mail to this mailing list so excuse me if
> I'm
> > doing something wrong. I was wondering if it's possible to reshape a
> > LINESTRING sfc of all connected segments into equal length segments.
> >
> > I tried to explain a little bit on why I want to do that here:
> >
> https://gis.stackexchange.com/questions/327376/how-to-divide-linestring-spatial-network-into-equal-length-segments-using-r-sf
> >
> > I'm pretty sure that I'm overcomplicating something simple and, in that
> > case, could you point me in the right direction?
> >
> > Thank you in advance
> > Andrea
> >
> >   [[alternative HTML version deleted]]
> >
> > ___
> > R-sig-Geo mailing list
> > R-sig-Geo@r-project.org
> > https://stat.ethz.ch/mailman/listinfo/r-sig-geo
> >
>
> --
> Edzer Pebesma
> Institute for Geoinformatics
> Heisenbergstrasse 2, 48151 Muenster, Germany
> Phone: +49 251 8333081
> ___
> R-sig-Geo mailing list
> R-sig-Geo@r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>

[[alternative HTML version deleted]]

___
R-sig-Geo mailing list
R-sig-Geo@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-geo


Re: [R-sig-Geo] How to reshape a LINESTRING sfc into equal length segments

2019-07-04 Thread Edzer Pebesma
You may want to look into sf::st_segmentize.

On 7/3/19 10:58 AM, Andrea Gilardi wrote:
> Hi everyone. This is my first mail to this mailing list so excuse me if I'm
> doing something wrong. I was wondering if it's possible to reshape a
> LINESTRING sfc of all connected segments into equal length segments.
> 
> I tried to explain a little bit on why I want to do that here:
> https://gis.stackexchange.com/questions/327376/how-to-divide-linestring-spatial-network-into-equal-length-segments-using-r-sf
> 
> I'm pretty sure that I'm overcomplicating something simple and, in that
> case, could you point me in the right direction?
> 
> Thank you in advance
> Andrea
> 
>   [[alternative HTML version deleted]]
> 
> ___
> R-sig-Geo mailing list
> R-sig-Geo@r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
> 

-- 
Edzer Pebesma
Institute for Geoinformatics
Heisenbergstrasse 2, 48151 Muenster, Germany
Phone: +49 251 8333081


pEpkey.asc
Description: application/pgp-keys
___
R-sig-Geo mailing list
R-sig-Geo@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-geo


[R-sig-Geo] How to reshape a LINESTRING sfc into equal length segments

2019-07-04 Thread Andrea Gilardi
Hi everyone. This is my first mail to this mailing list so excuse me if I'm
doing something wrong. I was wondering if it's possible to reshape a
LINESTRING sfc of all connected segments into equal length segments.

I tried to explain a little bit on why I want to do that here:
https://gis.stackexchange.com/questions/327376/how-to-divide-linestring-spatial-network-into-equal-length-segments-using-r-sf

I'm pretty sure that I'm overcomplicating something simple and, in that
case, could you point me in the right direction?

Thank you in advance
Andrea

[[alternative HTML version deleted]]

___
R-sig-Geo mailing list
R-sig-Geo@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-geo