[R-sig-Geo] Modelling land use/land cover under climate change scenarios

2024-05-11 Thread Manuel Spínola
Dear list members,

Is there a way in R or an R example code to model land use/land cover under
climate change scenario.



*Manuel Spínola, Ph.D.*
Instituto Internacional en Conservación y Manejo de Vida Silvestre
Universidad Nacional
Apartado 1350-3000
Heredia
COSTA RICA
mspin...@una.cr 
mspinol...@gmail.com
Teléfono: (506) 8706 - 4662
Sitio web institucional: ICOMVIS
<http://www.icomvis.una.ac.cr/index.php/manuel>
Sitio web personal: Sitio personal <https://mspinola-sitioweb.netlify.app>
Blog sobre Ciencia de Datos: Blog de Ciencia de Datos
<https://mspinola-ciencia-de-datos.netlify.app>

[[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] R packages for multivariate spatial models

2024-04-08 Thread Manuel Spínola
Thank you very much Roge.

Yes, this is the kind of multivariate spatial model I am looking for.
Particularly for areal or lattice data.



El lun, 8 abr 2024 a las 6:08, Roger Bivand ()
escribió:

> Is https://doi.org/10.32614/RJ-2023-068 more relevant? The article has
> suppleementary materials including multivariate responses for a number of
> settings.
>
> Hope this helps,
>
> Roger
>
> --
> Roger Bivand
> Emeritus Professor
> Norwegian School of Economics
> Postboks 3490 Ytre Sandviken, 5045 Bergen, Norway
> roger.biv...@nhh.no
>
> ________
> From: R-sig-Geo  on behalf of Manuel
> Spínola 
> Sent: 08 April 2024 13:47
> To: Jin Li
> Cc: r-sig-geo
> Subject: Re: [R-sig-Geo] R packages for multivariate spatial models
>
> [You don't often get email from mspinol...@gmail.com. Learn why this is
> important at https://aka.ms/LearnAboutSenderIdentification ]
>
> Thank you very much Sarah and Jin,
>
> I am referring to multivariate response spatial models.
>
>
>
> El dom, 7 abr 2024 a las 22:52, Jin Li () escribió:
>
> > Hi Manuel,
> >
> > If your models are for predictive purpose, `spm` and `spm2` are perhaps
> > the right packages for you. Some methods for spatial predictive modelling
> > are introduced in the `spm` and `spm2` packages, including such as modern
> > statistical methods (i.e., generalised linear models, glmnet, generalised
> > least squares), random forest, gbm, svm, kriging methods, and a number of
> > hybrid methods. For more information, please see "Spatial Predictive
> > Modeling with R" that provides many reproducible examples of these
> methods.
> >
> > Hope this helps,
> >
> > On Mon, Apr 8, 2024 at 7:14 AM Manuel Spínola 
> > wrote:
> >
> >> Dear list members,
> >>
> >> I am looking for suggestions of R packages to fit multivariate spatial
> >> models.
> >>
> >>
> >> --
> >> *Manuel Spínola, Ph.D.*
> >> Instituto Internacional en Conservación y Manejo de Vida Silvestre
> >> Universidad Nacional
> >> Apartado 1350-3000
> >> Heredia
> >> COSTA RICA
> >> mspin...@una.cr 
> >> mspinol...@gmail.com
> >> Teléfono: (506) 8706 - 4662
> >> Sitio web institucional: ICOMVIS
> >> <http://www.icomvis.una.ac.cr/index.php/manuel>
> >> Sitio web personal: Sitio personal <
> https://mspinola-sitioweb.netlify.app/
> >> >
> >> Blog sobre Ciencia de Datos: Blog de Ciencia de Datos
> >> <https://mspinola-ciencia-de-datos.netlify.app/>
> >>
> >> [[alternative HTML version deleted]]
> >>
> >> ___
> >> R-sig-Geo mailing list
> >> R-sig-Geo@r-project.org
> >> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
> >>
> >
> >
> > --
> > Jin
> > --
> > Jin Li, PhD
> > Founder, Data2action, Australia
> > https://www.researchgate.net/profile/Jin_Li32
> > https://scholar.google.com/citations?user=Jeot53EJ=en
> >
>
>
> --
> *Manuel Spínola, Ph.D.*
> Instituto Internacional en Conservación y Manejo de Vida Silvestre
> Universidad Nacional
> Apartado 1350-3000
> Heredia
> COSTA RICA
> mspin...@una.cr 
> mspinol...@gmail.com
> Teléfono: (506) 8706 - 4662
> Sitio web institucional: ICOMVIS
> <http://www.icomvis.una.ac.cr/index.php/manuel>
> Sitio web personal: Sitio personal <https://mspinola-sitioweb.netlify.app/
> >
> Blog sobre Ciencia de Datos: Blog de Ciencia de Datos
> <https://mspinola-ciencia-de-datos.netlify.app/>
>
> [[alternative HTML version deleted]]
>
> ___
> R-sig-Geo mailing list
> R-sig-Geo@r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>


-- 
*Manuel Spínola, Ph.D.*
Instituto Internacional en Conservación y Manejo de Vida Silvestre
Universidad Nacional
Apartado 1350-3000
Heredia
COSTA RICA
mspin...@una.cr 
mspinol...@gmail.com
Teléfono: (506) 8706 - 4662
Sitio web institucional: ICOMVIS
<http://www.icomvis.una.ac.cr/index.php/manuel>
Sitio web personal: Sitio personal <https://mspinola-sitioweb.netlify.app>
Blog sobre Ciencia de Datos: Blog de Ciencia de Datos
<https://mspinola-ciencia-de-datos.netlify.app>

[[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] R packages for multivariate spatial models

2024-04-08 Thread Manuel Spínola
Thank you very much Sarah and Jin,

I am referring to multivariate response spatial models.



El dom, 7 abr 2024 a las 22:52, Jin Li () escribió:

> Hi Manuel,
>
> If your models are for predictive purpose, `spm` and `spm2` are perhaps
> the right packages for you. Some methods for spatial predictive modelling
> are introduced in the `spm` and `spm2` packages, including such as modern
> statistical methods (i.e., generalised linear models, glmnet, generalised
> least squares), random forest, gbm, svm, kriging methods, and a number of
> hybrid methods. For more information, please see "Spatial Predictive
> Modeling with R" that provides many reproducible examples of these methods.
>
> Hope this helps,
>
> On Mon, Apr 8, 2024 at 7:14 AM Manuel Spínola 
> wrote:
>
>> Dear list members,
>>
>> I am looking for suggestions of R packages to fit multivariate spatial
>> models.
>>
>>
>> --
>> *Manuel Spínola, Ph.D.*
>> Instituto Internacional en Conservación y Manejo de Vida Silvestre
>> Universidad Nacional
>> Apartado 1350-3000
>> Heredia
>> COSTA RICA
>> mspin...@una.cr 
>> mspinol...@gmail.com
>> Teléfono: (506) 8706 - 4662
>> Sitio web institucional: ICOMVIS
>> <http://www.icomvis.una.ac.cr/index.php/manuel>
>> Sitio web personal: Sitio personal <https://mspinola-sitioweb.netlify.app
>> >
>> Blog sobre Ciencia de Datos: Blog de Ciencia de Datos
>> <https://mspinola-ciencia-de-datos.netlify.app>
>>
>> [[alternative HTML version deleted]]
>>
>> ___
>> R-sig-Geo mailing list
>> R-sig-Geo@r-project.org
>> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>>
>
>
> --
> Jin
> --
> Jin Li, PhD
> Founder, Data2action, Australia
> https://www.researchgate.net/profile/Jin_Li32
> https://scholar.google.com/citations?user=Jeot53EJ=en
>


-- 
*Manuel Spínola, Ph.D.*
Instituto Internacional en Conservación y Manejo de Vida Silvestre
Universidad Nacional
Apartado 1350-3000
Heredia
COSTA RICA
mspin...@una.cr 
mspinol...@gmail.com
Teléfono: (506) 8706 - 4662
Sitio web institucional: ICOMVIS
<http://www.icomvis.una.ac.cr/index.php/manuel>
Sitio web personal: Sitio personal <https://mspinola-sitioweb.netlify.app>
Blog sobre Ciencia de Datos: Blog de Ciencia de Datos
<https://mspinola-ciencia-de-datos.netlify.app>

[[alternative HTML version deleted]]

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


[R-sig-Geo] R packages for multivariate spatial models

2024-04-07 Thread Manuel Spínola
Dear list members,

I am looking for suggestions of R packages to fit multivariate spatial
models.


-- 
*Manuel Spínola, Ph.D.*
Instituto Internacional en Conservación y Manejo de Vida Silvestre
Universidad Nacional
Apartado 1350-3000
Heredia
COSTA RICA
mspin...@una.cr 
mspinol...@gmail.com
Teléfono: (506) 8706 - 4662
Sitio web institucional: ICOMVIS
<http://www.icomvis.una.ac.cr/index.php/manuel>
Sitio web personal: Sitio personal <https://mspinola-sitioweb.netlify.app>
Blog sobre Ciencia de Datos: Blog de Ciencia de Datos
<https://mspinola-ciencia-de-datos.netlify.app>

[[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] Recommendations for wildfire risk analysis (spatially explicit)

2024-01-30 Thread Manuel Spínola
Thank you very much.

Manuel

El lun, 22 ene 2024 a las 19:13, Dexter Locke ()
escribió:

>
> Possibly helpful:
> https://www.publish.csiro.au/WF/WF21176
> https://www.fs.usda.gov/research/treesearch/67085
>
> -Dexter
>
>
>
>
>
> On Sun, Jan 21, 2024 at 9:36 PM Ben Tupper  wrote:
>
>> Hi,
>>
>> Perhaps this might be a good place to start?
>>
>> https://esajournals.onlinelibrary.wiley.com/doi/10.1002/eap.1898  The
>> authors state that the work was done primarily in R.
>>
>> Cheers,
>> Ben
>>
>>
>> On Sat, Jan 20, 2024 at 9:43 AM Manuel Spínola 
>> wrote:
>> >
>> > Dear list members,
>> >
>> > I am looking for suggestions for R packages or an approach using R for
>> > wildfire risk analysis.
>> >
>> > Manuel
>> >
>> > --
>> > *Manuel Spínola, Ph.D.*
>> > Instituto Internacional en Conservación y Manejo de Vida Silvestre
>> > Universidad Nacional
>> > Apartado 1350-3000
>> > Heredia
>> > COSTA RICA
>> > mspin...@una.cr 
>> > mspinol...@gmail.com
>> > Teléfono: (506) 8706 - 4662
>> > Sitio web institucional: ICOMVIS
>> > <http://www.icomvis.una.ac.cr/index.php/manuel>
>> > Sitio web personal: Sitio personal <
>> https://mspinola-sitioweb.netlify.app>
>> > Blog sobre Ciencia de Datos: Blog de Ciencia de Datos
>> > <https://mspinola-ciencia-de-datos.netlify.app>
>> >
>> > [[alternative HTML version deleted]]
>> >
>> > ___
>> > R-sig-Geo mailing list
>> > R-sig-Geo@r-project.org
>> > https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>>
>> ___
>> R-sig-Geo mailing list
>> R-sig-Geo@r-project.org
>> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>>
>

-- 
*Manuel Spínola, Ph.D.*
Instituto Internacional en Conservación y Manejo de Vida Silvestre
Universidad Nacional
Apartado 1350-3000
Heredia
COSTA RICA
mspin...@una.cr 
mspinol...@gmail.com
Teléfono: (506) 8706 - 4662
Sitio web institucional: ICOMVIS
<http://www.icomvis.una.ac.cr/index.php/manuel>
Sitio web personal: Sitio personal <https://mspinola-sitioweb.netlify.app>
Blog sobre Ciencia de Datos: Blog de Ciencia de Datos
<https://mspinola-ciencia-de-datos.netlify.app>

[[alternative HTML version deleted]]

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


[R-sig-Geo] Recommendations for wildfire risk analysis (spatially explicit)

2024-01-20 Thread Manuel Spínola
Dear list members,

I am looking for suggestions for R packages or an approach using R for
wildfire risk analysis.

Manuel

-- 
*Manuel Spínola, Ph.D.*
Instituto Internacional en Conservación y Manejo de Vida Silvestre
Universidad Nacional
Apartado 1350-3000
Heredia
COSTA RICA
mspin...@una.cr 
mspinol...@gmail.com
Teléfono: (506) 8706 - 4662
Sitio web institucional: ICOMVIS
<http://www.icomvis.una.ac.cr/index.php/manuel>
Sitio web personal: Sitio personal <https://mspinola-sitioweb.netlify.app>
Blog sobre Ciencia de Datos: Blog de Ciencia de Datos
<https://mspinola-ciencia-de-datos.netlify.app>

[[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] maptools, rgdal, rgeos and rgrass7 retiring Monday, October 16

2023-10-03 Thread Manuel Spínola
I also echo all this comments.

Very grateful for Roger Bivand effort.

Manuel

On Tue, 3 Oct 2023 at 07:41 Sean Trende via R-sig-Geo <
r-sig-geo@r-project.org> wrote:

> Agreed 100%.  I'm blown away by the amount of work and care that you put
> into helping people use these packages. I never would have completed my
> dissertation without the willingness to respond thoughtfully to my
> obviously "noob" questions on this forum.
>
> -Original Message-
> From: R-sig-Geo  On Behalf Of Danlin Yu
> Sent: Tuesday, October 3, 2023 9:36 AM
> To: r-sig-geo@r-project.org
> Subject: Re: [R-sig-Geo] maptools, rgdal, rgeos and rgrass7 retiring
> Monday, October 16
>
> Dear Dr. Roger Bivand:
>
> I echo this comment and sentiment.
>
> Dr. Roger Bivand is not only a great scholar and generous contributor,
> maintainer to the R-spatial task force, but also a fantastic mentor to us
> all.
>
> No amount of "thank you" would be sufficient.
>
> Best,
>
> Danlin
>
> On 10/3/2023 5:22 AM, Gilberto Camara wrote:
> > Dear Roger
> >
> > Your enormous and generous dedication to R-spatial is amazing and a
> model to all of us!! Many, many thanks!
> >
> > All the best
> > Gilberto
> > 
> > Prof Dr Gilberto Camara
> > Senior Researcher
> > National Institute for Space Research (INPE), Brazil
> > https://gilbertocamara.org/ =
> >
> >
> >> On 3 Oct 2023, at 10:15, Roger Bivand  wrote:
> >>
> >> The legacy R spatial infrastructure packages maptools, rgdal and rgeos
> will be archived by CRAN on Monday, October 16, 2023; rgrass7 has  already
> been replaced by rgrass and will be archived with the retiring packages.
> >>
> >> The choice of date matches the previously announced archiving during
> October 2023, and the specific date matches the release schedule of
> Bioconductor 3.18 (some Bioconductor packages depend on retiring packages).
> >>
> >> sp_2.1-0 was published October 2, 2023, dropping all dependencies on
> the retiring packages. sp will continue to be available and maintained, but
> not developed further. Users of sp classes may continue to make use of
> them, but will have to use sf or terra to read, write or manipulate objects
> with coercion (for a guide to coercion, see
> https://cran.r-project.org/web/packages/rgrass/vignettes/coerce.html).
> >>
> >> Information about the evolution project may be found in reports and
> resources at https://r-spatial.github.io/evolution/; a recent blog by
> Jakub Nowosad may also be useful as an overview of what has been going on:
> https://geocompx.org/post/2023/rgdal-retirement/. For more detail, see
> https://r-spatial.github.io/evolution/ogh23_bivand.html and a video
> recording of this presentation https://av.tib.eu/media/63141 (August 28).
> >>
> >> All directly affected package maintainers have been alerted to the
> impending changes, some in December 2022, most others in March-April 2023.
> Many have already updated their packages on CRAN - thank you for your
> understanding! The remainder received github issue comments and email
> reminders in the last ten days, and will receive final notices to update by
> October 9.
> >>
> >> On R-universe, builds of packages archived on CRAN are dropped
> automatically (https://github.com/r-universe-org/help/issues/286).
> Read-only github mirrors of archived packages will remain available in
> principle while github exists (https://github.com/r-hub/rhub/issues/568),
> for example https://github.com/cran/rgdal. Other binary builds (Debian,
> Fedora, Ubuntu) have been alerted; support at Anaconda has been alerted.
> >>
> >> On CRAN, the retired packages will continue to be available as source
> packages on https://cran.r-project.org/src/contrib/Archive. maptools,
> rgdal and rgeos also retain their R-forge repositories, which may be used
> to retrieve functions for adding to other packages.
> >>
> >> A snapshot of Windows and macOS binary packages may be found on
> https://github.com/r-spatial/evolution/tree/main/backstore.
> >>
> >> Please raise questions by replying to this post, or as issues on
> https://github.com/r-spatial/evolution.
> >>
> >>
> >> --
> >> Roger Bivand
> >> Emeritus Professor
> >> Norwegian School of Economics
> >> Postboks 3490 Ytre Sandviken, 5045 Bergen, Norway roger.biv...@nhh.no
> >> ___
> >> R-sig-Geo mailing list
> >> R-sig-Geo@r-project.org
> >> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
> > ___
> > R-sig-Geo mailing list
> > R-sig-Geo@r-project.org
> > https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>
> --
> ___
> Danlin Yu, Ph.D.
> Professor of GIS and Urban Geography
> Department of Earth & Environmental Studies Montclair State University
> Montclair, NJ, 07043
> Tel: 973-655-4313
> Fax: 973-655-4072
> Office: CELS 314
> Email: y...@montclair.edu
> webpage: csam.montclair.edu/~yu
> Academic Editor and Editorial Board 

Re: [R-sig-Geo] Spatial nested grid in R

2023-02-10 Thread Manuel Spínola
Thank you very much Michael.

My idea is to create a spatial nested grid to conduct spatial surveys for a
monitoring protocol.

I am thinking to create an 8km, 4km, 2km and 1km nested grids so you can
use different tiles according to the desired resolution of species
occurrences, landscape metrics, or other metrics.

 See this
https://gis.stackexchange.com/questions/386664/creating-nested-grid-in-qgis

Manuel




El vie, 10 feb 2023 a las 16:38, Michael Sumner ()
escribió:

> One way is to write it to a (COG) GeoTIFF with overviews ("pyramid", or
> zoom levels) - these are pre-calculated copies of the highest resolution
> data saved as lower resolution versions.
>
> Do you want this to generate a set of nested data, or is it more about
> working with the nested logic?
>
> I'm not sure what version of GDAL is required to write one directly with
> terra or raster, but i'll explore. In terms of the nesting logic , you can
> read a particular zoom level (or model it with an data-empty object) and
> determine cell index using the cells tools in terra (or raster). I think
> you would need to generate xyFromCell and use that to cellFromXY between
> layers (the arithmetic is not onerous but doesn't exist for reuse anywhere
> in R afaik).
>
> I'm interested in this generally for workflows I'm using so might come
> back with an example, happy to follow up related questions.
>
> At the command line with COG format you can do
> gdalinfo in.tif overviews.if -of COG -co OVERVIEW_COUNT=3  ## 3, for
> example
>
> or
>
> gdal_translate in.tif overviews.tif
> gdaladdo overviews.tif 2 4 8
>
> but, of course there are implications with tile pattern and potential
> overlap for a given size. You'd probably also want tiling enabled and
> choose a particular tile size (perhaps to match the next resolution down).
> And I'd definitely want to make sure my extent was clean whole numbers and
> choose sensible sized zoom and tile levels.
>
> Cheers, Mike
>
>
> On Fri, Feb 10, 2023 at 10:22 AM Manuel Spínola 
> wrote:
>
>> Dear list members,
>>
>> Is it possible to generate a spatial nested grid in R?
>>
>> For example, a grid of several 8km x 8km tiles, and within that grid, I
>> want 4 tiles of 4km x 4km, and in each of those I want 4 tiles of 2km x
>> 2km, and in each of those I want 4 tiles of 1km x 1km.
>>
>> Manuel
>>
>> --
>> *Manuel Spínola, Ph.D.*
>> Instituto Internacional en Conservación y Manejo de Vida Silvestre
>> Universidad Nacional
>> Apartado 1350-3000
>> Heredia
>> COSTA RICA
>> mspin...@una.cr 
>> mspinol...@gmail.com
>> Teléfono: (506) 8706 - 4662
>> Institutional website: ICOMVIS
>> <http://www.icomvis.una.ac.cr/index.php/manuel>
>> Blog sobre Ciencia de Datos:
>> https://mspinola-ciencia-de-datos.netlify.app
>>
>> [[alternative HTML version deleted]]
>>
>> ___________
>> R-sig-Geo mailing list
>> R-sig-Geo@r-project.org
>> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>>
>
>
> --
> Michael Sumner
> Software and Database Engineer
> Australian Antarctic Division
> Hobart, Australia
> e-mail: mdsum...@gmail.com
>


-- 
*Manuel Spínola, Ph.D.*
Instituto Internacional en Conservación y Manejo de Vida Silvestre
Universidad Nacional
Apartado 1350-3000
Heredia
COSTA RICA
mspin...@una.cr 
mspinol...@gmail.com
Teléfono: (506) 8706 - 4662
Institutional website: ICOMVIS
<http://www.icomvis.una.ac.cr/index.php/manuel>
Blog sobre Ciencia de Datos: https://mspinola-ciencia-de-datos.netlify.app

[[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] st_intersection produce Geometry type: GEOMETRY instead of Geometry type: POLYGON

2023-02-10 Thread Manuel Spínola
Thank you very much Marcelino.

That works.

I also find that this works (with terra):

g_25000_c <- crop(vect(g_25000), vect(g_5_d))

g_25000_c <- st_as_sf(g_25000_c)


El vie, 10 feb 2023 a las 15:06, Marcelino de la Cruz Rot (<
marcelino.delac...@urjc.es>) escribió:

>
> g_25000_c_polygons_only <- g_25000_c[st_is(x = g_25000_c, type =
> "POLYGON"),] # with a comma
>
>
> El 10/02/2023 a las 21:33, Manuel Spínola escribió:
> > Thnak you very much Bede-Fazekas.
> >
> > I got the following error:
> >
> > g_25000_c_polygons_only <- g_25000_c[st_is(x = g_25000_c, type =
> "POLYGON")]
> >
> > Error in `[.data.frame`(x, i) : undefined columns selected
> >
> > El vie, 10 feb 2023 a las 11:53, Bede-Fazekas Ákos (<
> bfalevl...@gmail.com>)
> > escribió:
> >
> >> Dear Manuel,
> >>
> >> technically, the result of st_intersection(x, y), where both x and y are
> >> POLYGONs, can be POINT, LINESTRING, POLGYON and GEOMETRY as well. The
> >> result is GEOMETRY if the type of the different features is not the same
> >> (e.g. POLYGON+POINT).
> >> You can subset the result in this way:
> >> g_25000_c_polygons_only <- g_25000_c[st_is(x = g_25000_c, type =
> >> "POLYGON")]
> >>
> >> HTH,
> >> Ákos
> >> ___
> >> Ákos Bede-Fazekas
> >> Centre for Ecological Research, Hungary
> >>
> >> 2023.02.10. 18:32 keltezéssel, Manuel Spínola írta:
> >>> Dear list members,
> >>>
> >>> I am trying to "crop" a polygon (grid) with a polygon, but the result
> is
> >> an
> >>> sf object Geometry type: GEOMETRY, instead of an sf object Geometry
> type:
> >>> POLYGON.
> >>>
> >>> How can I obtain an sf POLYGON?
> >>>
> >>> nc = st_read(system.file("shape/nc.shp", package="sf"))
> >>>
> >>>
> >>>
> >>> nc <- st_transform(nc, 3857)
> >>>
> >>>
> >>>
> >>> g_5 <- st_make_grid(nc, cellsize = 5) |> st_as_sf()
> >>>
> >>>
> >>>
> >>> g_5 <- g_5[nc, ]
> >>>
> >>>
> >>>
> >>> g_5_d <- st_union(g_5)
> >>>
> >>>
> >>>
> >>> g_25000 = st_make_grid(g_5_d, cellsize = 25000) |> st_as_sf()
> >>>
> >>>
> >>>
> >>> g_25000 # Geometry type: POLYGON
> >>>
> >>>
> >>>
> >>> g_25000_c <- st_intersection(g_25000, g_5_d)
> >>>
> >>>
> >>>
> >>> g_25000_c # Geometry type: GEOMETRY
> >>>
> >>>
> >>>
> >>>
> >> ___
> >> R-sig-Geo mailing list
> >> R-sig-Geo@r-project.org
> >> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
> >>
> >
>
> --
> Marcelino de la Cruz Rot
> Coordinador funcional de Biología
> Depto. de Biología y Geología
> Física y Química Inorgánica
> Universidad Rey Juan Carlos
> Móstoles España
>
> ___
> R-sig-Geo mailing list
> R-sig-Geo@r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>


-- 
*Manuel Spínola, Ph.D.*
Instituto Internacional en Conservación y Manejo de Vida Silvestre
Universidad Nacional
Apartado 1350-3000
Heredia
COSTA RICA
mspin...@una.cr 
mspinol...@gmail.com
Teléfono: (506) 8706 - 4662
Institutional website: ICOMVIS
<http://www.icomvis.una.ac.cr/index.php/manuel>
Blog sobre Ciencia de Datos: https://mspinola-ciencia-de-datos.netlify.app

[[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] Spatial nested grid in R

2023-02-10 Thread Manuel Spínola
Thank you very much Marcelino.

Manuel

El vie, 10 feb 2023 a las 13:00, Marcelino de la Cruz Rot (<
marcelino.delac...@urjc.es>) escribió:

> El 10/02/2023 a las 15:13, Roger Bivand escribió:
> > On Fri, 10 Feb 2023, Marcelino de la Cruz Rot wrote:
> >
> >> It depends on what you mean by "overimpose".
> >>
> >> Maybe this way?
> >>
> >> # some spatial polygon
> >
> > Please, in the spirit of the evolving r-spatial package ecosystem
> > (maptools will retire during 2023):
> >
> > library(sf)
> > R <- st_as_sf(affine(letterR, mat=diag(c(20,20
> > plot(R, border="blue")
> >
> > See https://r-spatial.org/r/2022/12/14/evolution2.html, maybe
> > https://rsbivand.github.io/csds_jan23/bivand_csds_ssg_230117.pdf and
> >
> https://www.youtube.com/watch?v=TlpjIqTPMCA=PLzREt6r1NenmWEidssmLm-VO_YmAh4pq9=1
> >
> > Roger
>
> Thank you Roger!
>
> In the spirit of the evolving, I then suggest this to Manuel:
>
> # define this function (if it is not in your  version of sf)
>
> st_as_sf.tess <- sf:::st_as_sf.owin
>
> # transform tesselations in sf's
>
> Dsf <-  st_as_sf(D)
> Csf <-  st_as_sf(C)
> Bsf <- st_as_sf(B)
> Asf <- st_as_sf(A)
>
> # crop tesselations with spatial polygon
>
> RDsf <- Dsf[R,]
> RCsf <- Csf[R,]
> RBsf <- Bsf[R,]
> RAsf <- Asf[R,]
>
> #overimpose cropped grids
> plot(RAsf)
> plot(RDsf, border="green", add=T)
> plot(RCsf, border="blue", add=T)
> plot(RBsf, border="red", add=T)
> plot(RAsf, add=T)
>
> Cheers,
>
> Marcelino
>
>
>
>
>
>
>
> >
> >> library(maptools)
> >> R <- as(affine(letterR, mat=diag(c(20,20))), "SpatialPolygons")
> >> plot(R, border="blue")
> >>
> >> # "overimpose" grids A to C on R:
> >> plot(C, border="green", add=T)
> >> plot(B, border="red", add=T)
> >> plot(A, add=T)
> >>
> >> Cheers,
> >> Marcelino
> >>
> >>
> >>
> >> El 10/02/2023 a las 13:29, Manuel Spínola escribió:
> >>>  Thank you very much Marcelino.
> >>>
> >>>  And how can overimpose those grids to a spatial polygon?
> >>>
> >>>  Manuel
> >>>
> >>>  On Fri, 10 Feb 2023 at 03:09 Marcelino de la Cruz Rot
> >>>   wrote:
> >>>
> >>>  Dear Manuel,
> >>>  This is R. There is no "it is possible". Only "how" ;-).
> >>>
> >>>  For example, with spatstat.geom,
> >>>
> >>>  A <- tess(xgrid=seq(0,80, by=8),ygrid=seq(0,80, by=8))
> >>>  B <- tess(xgrid=seq(0,80, by=4),ygrid=seq(0,80, by=4))
> >>>  C <- tess(xgrid=seq(0,80, by=2),ygrid=seq(0,80, by=2))
> >>>  D <- tess(xgrid=seq(0,80, by=1),ygrid=seq(0,80, by=1))
> >>>
> >>>  Cheers,
> >>>  Marcelino
> >>>
> >>>
> >>>  El 10/02/2023 a las 0:21, Manuel Spínola escribió:
> >>> >  Dear list members,
> >>> >
> >>> >  Is it possible to generate a spatial nested grid in R?
> >>> >
> >>> >  For example, a grid of several 8km x 8km tiles, and within that
> >>>  grid, I
> >>> >  want 4 tiles of 4km x 4km, and in each of those I want 4 tiles
> >>>  of 2km x
> >>> >  2km, and in each of those I want 4 tiles of 1km x 1km.
> >>> >
> >>> >  Manuel
> >>> >
> >>>  --
> >>>  Marcelino de la Cruz Rot
> >>>  Coordinador funcional de Biología
> >>>  Depto. de Biología y Geología
> >>>  Física y Química Inorgánica
> >>>  Universidad Rey Juan Carlos
> >>>  Móstoles España
> >>>
> >>>  ___
> >>>  R-sig-Geo mailing list
> >>>  R-sig-Geo@r-project.org
> >>>
> https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fstat.ethz.ch%2Fmailman%2Flistinfo%2Fr-sig-geo=05%7C01%7CRoger.Bivand%40nhh.no%7C0b29de36aca54242ddf008db0b6ade31%7C33a15b2f849941998d56f20b5aa91af2%7C0%7C0%7C638116325854200214%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C=Ngv4yEcnP6JM4zq5rpVgzcYgRHAFwPPS8JRFhMaRA58%3D=0
> >>>
>

Re: [R-sig-Geo] st_intersection produce Geometry type: GEOMETRY instead of Geometry type: POLYGON

2023-02-10 Thread Manuel Spínola
Thank you very much Josiah.

If I ran the code you suggested me, How I get the g_25000 object (a grid)?

index <- which(lengths(st_intersects(g_5, nc)) > 0)
plot(st_union(g_5[index,]))



El vie, 10 feb 2023 a las 12:10, Josiah Parry ()
escribió:

> Manuel, I think you're looking for an intersect*s* rather than the
> intersection. Is the following what you're after?
>
>
> nc = st_read(system.file("shape/nc.shp", package="sf"))
> nc <- st_transform(nc, 3857)
> g_5 <- st_make_grid(nc, cellsize = 5) |> st_as_sf()
> g_5 <- g_5[nc, ]
> g_5_d <- st_union(g_5)
> g_25000 = st_make_grid(g_5_d, cellsize = 25000) |> st_as_sf()
> g_25000 # Geometry type: POLYGON
>
> index <- which(lengths(st_intersects(g_5, nc)) > 0)
> plot(st_union(g_5[index,]))
>
> On Fri, Feb 10, 2023 at 12:53 PM Bede-Fazekas Ákos 
> wrote:
>
> > Dear Manuel,
> >
> > technically, the result of st_intersection(x, y), where both x and y are
> > POLYGONs, can be POINT, LINESTRING, POLGYON and GEOMETRY as well. The
> > result is GEOMETRY if the type of the different features is not the same
> > (e.g. POLYGON+POINT).
> > You can subset the result in this way:
> > g_25000_c_polygons_only <- g_25000_c[st_is(x = g_25000_c, type =
> > "POLYGON")]
> >
> > HTH,
> > Ákos
> > ___
> > Ákos Bede-Fazekas
> > Centre for Ecological Research, Hungary
> >
> > 2023.02.10. 18:32 keltezéssel, Manuel Spínola írta:
> > > Dear list members,
> > >
> > > I am trying to "crop" a polygon (grid) with a polygon, but the result
> is
> > an
> > > sf object Geometry type: GEOMETRY, instead of an sf object Geometry
> type:
> > > POLYGON.
> > >
> > > How can I obtain an sf POLYGON?
> > >
> > > nc = st_read(system.file("shape/nc.shp", package="sf"))
> > >
> > >
> > >
> > > nc <- st_transform(nc, 3857)
> > >
> > >
> > >
> > > g_5 <- st_make_grid(nc, cellsize = 5) |> st_as_sf()
> > >
> > >
> > >
> > > g_5 <- g_5[nc, ]
> > >
> > >
> > >
> > > g_5_d <- st_union(g_5)
> > >
> > >
> > >
> > > g_25000 = st_make_grid(g_5_d, cellsize = 25000) |> st_as_sf()
> > >
> > >
> > >
> > > g_25000 # Geometry type: POLYGON
> > >
> > >
> > >
> > > g_25000_c <- st_intersection(g_25000, g_5_d)
> > >
> > >
> > >
> > > g_25000_c # Geometry type: GEOMETRY
> > >
> > >
> > >
> > >
> >
> > ___
> > 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
>


-- 
*Manuel Spínola, Ph.D.*
Instituto Internacional en Conservación y Manejo de Vida Silvestre
Universidad Nacional
Apartado 1350-3000
Heredia
COSTA RICA
mspin...@una.cr 
mspinol...@gmail.com
Teléfono: (506) 8706 - 4662
Institutional website: ICOMVIS
<http://www.icomvis.una.ac.cr/index.php/manuel>
Blog sobre Ciencia de Datos: https://mspinola-ciencia-de-datos.netlify.app

[[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] st_intersection produce Geometry type: GEOMETRY instead of Geometry type: POLYGON

2023-02-10 Thread Manuel Spínola
Thnak you very much Bede-Fazekas.

I got the following error:

g_25000_c_polygons_only <- g_25000_c[st_is(x = g_25000_c, type = "POLYGON")]

Error in `[.data.frame`(x, i) : undefined columns selected

El vie, 10 feb 2023 a las 11:53, Bede-Fazekas Ákos ()
escribió:

> Dear Manuel,
>
> technically, the result of st_intersection(x, y), where both x and y are
> POLYGONs, can be POINT, LINESTRING, POLGYON and GEOMETRY as well. The
> result is GEOMETRY if the type of the different features is not the same
> (e.g. POLYGON+POINT).
> You can subset the result in this way:
> g_25000_c_polygons_only <- g_25000_c[st_is(x = g_25000_c, type =
> "POLYGON")]
>
> HTH,
> Ákos
> ___
> Ákos Bede-Fazekas
> Centre for Ecological Research, Hungary
>
> 2023.02.10. 18:32 keltezéssel, Manuel Spínola írta:
> > Dear list members,
> >
> > I am trying to "crop" a polygon (grid) with a polygon, but the result is
> an
> > sf object Geometry type: GEOMETRY, instead of an sf object Geometry type:
> > POLYGON.
> >
> > How can I obtain an sf POLYGON?
> >
> > nc = st_read(system.file("shape/nc.shp", package="sf"))
> >
> >
> >
> > nc <- st_transform(nc, 3857)
> >
> >
> >
> > g_5 <- st_make_grid(nc, cellsize = 5) |> st_as_sf()
> >
> >
> >
> > g_5 <- g_5[nc, ]
> >
> >
> >
> > g_5_d <- st_union(g_5)
> >
> >
> >
> > g_25000 = st_make_grid(g_5_d, cellsize = 25000) |> st_as_sf()
> >
> >
> >
> > g_25000 # Geometry type: POLYGON
> >
> >
> >
> > g_25000_c <- st_intersection(g_25000, g_5_d)
> >
> >
> >
> > g_25000_c # Geometry type: GEOMETRY
> >
> >
> >
> >
>
> ___
> R-sig-Geo mailing list
> R-sig-Geo@r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>


-- 
*Manuel Spínola, Ph.D.*
Instituto Internacional en Conservación y Manejo de Vida Silvestre
Universidad Nacional
Apartado 1350-3000
Heredia
COSTA RICA
mspin...@una.cr 
mspinol...@gmail.com
Teléfono: (506) 8706 - 4662
Institutional website: ICOMVIS
<http://www.icomvis.una.ac.cr/index.php/manuel>
Blog sobre Ciencia de Datos: https://mspinola-ciencia-de-datos.netlify.app

[[alternative HTML version deleted]]

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


[R-sig-Geo] st_intersection produce Geometry type: GEOMETRY instead of Geometry type: POLYGON

2023-02-10 Thread Manuel Spínola
Dear list members,

I am trying to "crop" a polygon (grid) with a polygon, but the result is an
sf object Geometry type: GEOMETRY, instead of an sf object Geometry type:
POLYGON.

How can I obtain an sf POLYGON?

nc = st_read(system.file("shape/nc.shp", package="sf"))



nc <- st_transform(nc, 3857)



g_5 <- st_make_grid(nc, cellsize = 5) |> st_as_sf()



g_5 <- g_5[nc, ]



g_5_d <- st_union(g_5)



g_25000 = st_make_grid(g_5_d, cellsize = 25000) |> st_as_sf()



g_25000 # Geometry type: POLYGON



g_25000_c <- st_intersection(g_25000, g_5_d)



g_25000_c # Geometry type: GEOMETRY




-- 
*Manuel Spínola, Ph.D.*
Instituto Internacional en Conservación y Manejo de Vida Silvestre
Universidad Nacional
Apartado 1350-3000
Heredia
COSTA RICA
mspin...@una.cr 
mspinol...@gmail.com
Teléfono: (506) 8706 - 4662
Institutional website: ICOMVIS
<http://www.icomvis.una.ac.cr/index.php/manuel>
Blog sobre Ciencia de Datos: https://mspinola-ciencia-de-datos.netlify.app

[[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] Spatial nested grid in R

2023-02-10 Thread Manuel Spínola
Thank you very much Roger.

Manuel

El vie, 10 feb 2023 a las 8:13, Roger Bivand ()
escribió:

> On Fri, 10 Feb 2023, Marcelino de la Cruz Rot wrote:
>
> > It depends on what you mean by "overimpose".
> >
> > Maybe this way?
> >
> > # some spatial polygon
>
> Please, in the spirit of the evolving r-spatial package ecosystem
> (maptools will retire during 2023):
>
> library(sf)
> R <- st_as_sf(affine(letterR, mat=diag(c(20,20
> plot(R, border="blue")
>
> See https://r-spatial.org/r/2022/12/14/evolution2.html, maybe
> https://rsbivand.github.io/csds_jan23/bivand_csds_ssg_230117.pdf and
>
> https://www.youtube.com/watch?v=TlpjIqTPMCA=PLzREt6r1NenmWEidssmLm-VO_YmAh4pq9=1
>
> Roger
>
> > library(maptools)
> > R <- as(affine(letterR, mat=diag(c(20,20))), "SpatialPolygons")
> > plot(R, border="blue")
> >
> > # "overimpose" grids A to C on R:
> > plot(C, border="green", add=T)
> > plot(B, border="red", add=T)
> > plot(A, add=T)
> >
> > Cheers,
> > Marcelino
> >
> >
> >
> > El 10/02/2023 a las 13:29, Manuel Spínola escribió:
> >>  Thank you very much Marcelino.
> >>
> >>  And how can overimpose those grids to a spatial polygon?
> >>
> >>  Manuel
> >>
> >>  On Fri, 10 Feb 2023 at 03:09 Marcelino de la Cruz Rot
> >>   wrote:
> >>
> >>  Dear Manuel,
> >>  This is R. There is no "it is possible". Only "how" ;-).
> >>
> >>  For example, with spatstat.geom,
> >>
> >>  A <- tess(xgrid=seq(0,80, by=8),ygrid=seq(0,80, by=8))
> >>  B <- tess(xgrid=seq(0,80, by=4),ygrid=seq(0,80, by=4))
> >>  C <- tess(xgrid=seq(0,80, by=2),ygrid=seq(0,80, by=2))
> >>  D <- tess(xgrid=seq(0,80, by=1),ygrid=seq(0,80, by=1))
> >>
> >>  Cheers,
> >>  Marcelino
> >>
> >>
> >>  El 10/02/2023 a las 0:21, Manuel Spínola escribió:
> >> >  Dear list members,
> >> >
> >> >  Is it possible to generate a spatial nested grid in R?
> >> >
> >> >  For example, a grid of several 8km x 8km tiles, and within that
> >>  grid, I
> >> >  want 4 tiles of 4km x 4km, and in each of those I want 4 tiles
> >>  of 2km x
> >> >  2km, and in each of those I want 4 tiles of 1km x 1km.
> >> >
> >> >  Manuel
> >> >
> >>
> >>  --
> >>  Marcelino de la Cruz Rot
> >>  Coordinador funcional de Biología
> >>  Depto. de Biología y Geología
> >>  Física y Química Inorgánica
> >>  Universidad Rey Juan Carlos
> >>  Móstoles España
> >>
> >>  ___
> >>  R-sig-Geo mailing list
> >>  R-sig-Geo@r-project.org
> >>
> https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fstat.ethz.ch%2Fmailman%2Flistinfo%2Fr-sig-geo=05%7C01%7CRoger.Bivand%40nhh.no%7C0b29de36aca54242ddf008db0b6ade31%7C33a15b2f849941998d56f20b5aa91af2%7C0%7C0%7C638116325854200214%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C=Ngv4yEcnP6JM4zq5rpVgzcYgRHAFwPPS8JRFhMaRA58%3D=0
> >>
> >>  --
> >>  *Manuel Spínola, Ph.D.*
> >>  Instituto Internacional en Conservación y Manejo de Vida Silvestre
> >>  Universidad Nacional
> >>  Apartado 1350-3000
> >>  Heredia
> >>  COSTA RICA
> >>  mspin...@una.cr <mailto:mspin...@una.ac.cr>
> >>  mspinol...@gmail.com
> >>  Teléfono: (506) 8706 - 4662
> >>  Institutional website: ICOMVIS
> >>  <
> https://eur02.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.icomvis.una.ac.cr%2Findex.php%2Fmanuel=05%7C01%7CRoger.Bivand%40nhh.no%7C0b29de36aca54242ddf008db0b6ade31%7C33a15b2f849941998d56f20b5aa91af2%7C0%7C0%7C638116325854200214%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C=fCKSKsYuj7JXD5CbsQDKFUkeAVpqekVl%2BbTYM2dpuzU%3D=0
> >
> >>  Blog sobre Ciencia de Datos:
> >>
> https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fmspinola-ciencia-de-datos.netlify.app%2F=05%7C01%7CRoger.Bivand%40nhh.no%7C0b29de36aca54242ddf008db0b6ade31%7C33a15b2f849941998d56f20b5aa91af2%7C0%7C0%7C638116325854200214%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000

Re: [R-sig-Geo] Spatial nested grid in R

2023-02-10 Thread Manuel Spínola
Thank you very much Marcelino.

Manuel

El vie, 10 feb 2023 a las 7:29, Marcelino de la Cruz Rot (<
marcelino.delac...@urjc.es>) escribió:

> It depends on what you mean by "overimpose".
>
> Maybe this way?
>
> # some spatial polygon
> library(maptools)
> R <- as(affine(letterR, mat=diag(c(20,20))), "SpatialPolygons")
> plot(R, border="blue")
>
> # "overimpose" grids A to C on R:
> plot(C, border="green", add=T)
> plot(B, border="red", add=T)
> plot(A, add=T)
>
> Cheers,
> Marcelino
>
>
>
> El 10/02/2023 a las 13:29, Manuel Spínola escribió:
> > Thank you very much Marcelino.
> >
> > And how can overimpose those grids to a spatial polygon?
> >
> > Manuel
> >
> > On Fri, 10 Feb 2023 at 03:09 Marcelino de la Cruz Rot
> >  wrote:
> >
> > Dear Manuel,
> > This is R. There is no "it is possible". Only "how" ;-).
> >
> > For example, with spatstat.geom,
> >
> > A <- tess(xgrid=seq(0,80, by=8),ygrid=seq(0,80, by=8))
> > B <- tess(xgrid=seq(0,80, by=4),ygrid=seq(0,80, by=4))
> > C <- tess(xgrid=seq(0,80, by=2),ygrid=seq(0,80, by=2))
> > D <- tess(xgrid=seq(0,80, by=1),ygrid=seq(0,80, by=1))
> >
> > Cheers,
> > Marcelino
> >
> >
> > El 10/02/2023 a las 0:21, Manuel Spínola escribió:
> > > Dear list members,
> > >
> > > Is it possible to generate a spatial nested grid in R?
> > >
> > > For example, a grid of several 8km x 8km tiles, and within that
> > grid, I
> > > want 4 tiles of 4km x 4km, and in each of those I want 4 tiles
> > of 2km x
> > > 2km, and in each of those I want 4 tiles of 1km x 1km.
> > >
> > > Manuel
> > >
> >
> > --
> > Marcelino de la Cruz Rot
> > Coordinador funcional de Biología
> > Depto. de Biología y Geología
> > Física y Química Inorgánica
> > Universidad Rey Juan Carlos
> > Móstoles España
> >
> > ___
> > R-sig-Geo mailing list
> > R-sig-Geo@r-project.org
> > https://stat.ethz.ch/mailman/listinfo/r-sig-geo
> >
> > --
> > *Manuel Spínola, Ph.D.*
> > Instituto Internacional en Conservación y Manejo de Vida Silvestre
> > Universidad Nacional
> > Apartado 1350-3000
> > Heredia
> > COSTA RICA
> > mspin...@una.cr <mailto:mspin...@una.ac.cr>
> > mspinol...@gmail.com
> > Teléfono: (506) 8706 - 4662
> > Institutional website: ICOMVIS
> > <http://www.icomvis.una.ac.cr/index.php/manuel>
> > Blog sobre Ciencia de Datos:
> https://mspinola-ciencia-de-datos.netlify.app
>
>
> --
> Marcelino de la Cruz Rot
> Coordinador funcional de Biología
> Depto. de Biología y Geología
> Física y Química Inorgánica
> Universidad Rey Juan Carlos
> Móstoles España
>
> ___
> R-sig-Geo mailing list
> R-sig-Geo@r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>


-- 
*Manuel Spínola, Ph.D.*
Instituto Internacional en Conservación y Manejo de Vida Silvestre
Universidad Nacional
Apartado 1350-3000
Heredia
COSTA RICA
mspin...@una.cr 
mspinol...@gmail.com
Teléfono: (506) 8706 - 4662
Institutional website: ICOMVIS
<http://www.icomvis.una.ac.cr/index.php/manuel>
Blog sobre Ciencia de Datos: https://mspinola-ciencia-de-datos.netlify.app

[[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] Spatial nested grid in R

2023-02-10 Thread Manuel Spínola
Thank you very much Marcelino.

And how can overimpose those grids to a spatial polygon?

Manuel

On Fri, 10 Feb 2023 at 03:09 Marcelino de la Cruz Rot <
marcelino.delac...@urjc.es> wrote:

> Dear Manuel,
> This is R. There is no "it is possible". Only "how" ;-).
>
> For example, with spatstat.geom,
>
> A <- tess(xgrid=seq(0,80, by=8),ygrid=seq(0,80, by=8))
> B <- tess(xgrid=seq(0,80, by=4),ygrid=seq(0,80, by=4))
> C <- tess(xgrid=seq(0,80, by=2),ygrid=seq(0,80, by=2))
> D <- tess(xgrid=seq(0,80, by=1),ygrid=seq(0,80, by=1))
>
> Cheers,
> Marcelino
>
>
> El 10/02/2023 a las 0:21, Manuel Spínola escribió:
> > Dear list members,
> >
> > Is it possible to generate a spatial nested grid in R?
> >
> > For example, a grid of several 8km x 8km tiles, and within that grid, I
> > want 4 tiles of 4km x 4km, and in each of those I want 4 tiles of 2km x
> > 2km, and in each of those I want 4 tiles of 1km x 1km.
> >
> > Manuel
> >
>
> --
> Marcelino de la Cruz Rot
> Coordinador funcional de Biología
> Depto. de Biología y Geología
> Física y Química Inorgánica
> Universidad Rey Juan Carlos
> Móstoles España
>
> ___
> R-sig-Geo mailing list
> R-sig-Geo@r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>
-- 
*Manuel Spínola, Ph.D.*
Instituto Internacional en Conservación y Manejo de Vida Silvestre
Universidad Nacional
Apartado 1350-3000
Heredia
COSTA RICA
mspin...@una.cr 
mspinol...@gmail.com
Teléfono: (506) 8706 - 4662
Institutional website: ICOMVIS
<http://www.icomvis.una.ac.cr/index.php/manuel>
Blog sobre Ciencia de Datos: https://mspinola-ciencia-de-datos.netlify.app

[[alternative HTML version deleted]]

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


[R-sig-Geo] Spatial nested grid in R

2023-02-09 Thread Manuel Spínola
Dear list members,

Is it possible to generate a spatial nested grid in R?

For example, a grid of several 8km x 8km tiles, and within that grid, I
want 4 tiles of 4km x 4km, and in each of those I want 4 tiles of 2km x
2km, and in each of those I want 4 tiles of 1km x 1km.

Manuel

-- 
*Manuel Spínola, Ph.D.*
Instituto Internacional en Conservación y Manejo de Vida Silvestre
Universidad Nacional
Apartado 1350-3000
Heredia
COSTA RICA
mspin...@una.cr 
mspinol...@gmail.com
Teléfono: (506) 8706 - 4662
Institutional website: ICOMVIS
<http://www.icomvis.una.ac.cr/index.php/manuel>
Blog sobre Ciencia de Datos: https://mspinola-ciencia-de-datos.netlify.app

[[alternative HTML version deleted]]

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


[R-sig-Geo] Announcig 2 R data packages with geospatial data for Costa Rica and Central America

2023-01-25 Thread Manuel Spínola
Dear list members,

I would like to announce 2 R packages with geospatial data:

cageo, an R package with geospatial data of Central America.

https://github.com/ManuelSpinola/cageo

crgeo, an R package with geospatial data of Costa Rica

https://github.com/ManuelSpinola/crgeo

-- 
*Manuel Spínola, Ph.D.*
Instituto Internacional en Conservación y Manejo de Vida Silvestre
Universidad Nacional
Apartado 1350-3000
Heredia
COSTA RICA
mspin...@una.cr 
mspinol...@gmail.com
Teléfono: (506) 8706 - 4662
Institutional website: ICOMVIS
<http://www.icomvis.una.ac.cr/index.php/manuel>
Blog sobre Ciencia de Datos: https://mspinola-ciencia-de-datos.netlify.app

[[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] geodata package: CMIP6 climate model data downloading error

2023-01-25 Thread Manuel Spínola
Thank you very much Ákos.

I was trying in Safari, I switched to firefox, and seems to work.

Manuel

El mié, 25 ene 2023 a las 9:02, Bede-Fazekas Ákos ()
escribió:

> Dear Manuel,
>
> for me this link (
> https://geodata.ucdavis.edu/cmip6/30s/ACCESS-CM2/ssp126/wc2.1_30s_bioc_ACCESS-CM2_ssp126_2021-2040.tif)
> works perfectly in Firefox browser. It starts downloading the geoTiff file.
> I think it should work with download.file() from R as well.
>
> Alternatively, you can try package "easyclimate". I have no experience
> with this package, only read the scientific paper about this:
> https://www.sciencedirect.com/science/article/pii/S1364815223000130?dgcid=rss_sd_all
> Please note that it is about daily climate instead of long-term averages.
>
> HTH,
> Ákos
> _
> Ákos Bede-Fazekas
> Centre for Ecological Research, Hungary
>
> 2023.01.25. 15:48 keltezéssel, Manuel Spínola írta:
>
> Thank you very much Ákos.
>
> It didn't work either.
>
> Is there any other package that allows to download future climate change
> scenarios?
>
> Manuel
>
>
>
> El mié, 25 ene 2023 a las 1:27, Bede-Fazekas Ákos ()
> escribió:
>
>> Dear Manuel,
>>
>> There are some broken links in the WorldClim website. If you find one,
>> you can write to i...@worldclim.org. Although I have negative
>> experiences, you should try this way.
>> Anyway, the global, non-tiled raster can be downloaded from this link:
>>
>> https://geodata.ucdavis.edu/cmip6/30s/ACCESS-CM2/ssp126/wc2.1_30s_bioc_ACCESS-CM2_ssp126_2021-2040.tif
>>
>> Have a nice week,
>> Ákos
>>
>> _
>> Ákos Bede-Fazekas
>> Centre for Ecological Research, Hungary
>>
>> 2023.01.24. 23:29 keltezéssel, Manuel Spínola írta:
>> > Dear list members,
>> >
>> > I am trying to download CMIP6 climate model data using the R package
>> > geodata but I got this error message:
>> >
>> > bio <- cmip6_tile(lon = -84, lat = 10,"ACCESS-CM2", "126", "2021-2040",
>> > var="bioc", path = "climate_ckange")
>> > trying URL '
>> >
>> https://geodata.ucdavis.edu/cmip6/tiles/ACCESS-CM2/ssp126/wc2.1_30s_bioc_ACCESS-CM2_ssp126_2021-2040_tile-28.tif
>> > '
>> > Error in utils::download.file(url = url, destfile = filename, quiet =
>> > quiet,  :
>> >cannot open URL '
>> >
>> https://geodata.ucdavis.edu/cmip6/tiles/ACCESS-CM2/ssp126/wc2.1_30s_bioc_ACCESS-CM2_ssp126_2021-2040_tile-28.tif
>> > '
>> > download failed
>> >
>> > I cannot even download the data using the worldclim website.
>> >
>> >
>>
>> ___
>> R-sig-Geo mailing list
>> R-sig-Geo@r-project.org
>> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>>
>
>
> --
> *Manuel Spínola, Ph.D.*
> Instituto Internacional en Conservación y Manejo de Vida Silvestre
> Universidad Nacional
> Apartado 1350-3000
> Heredia
> COSTA RICA
> mspin...@una.cr 
> mspinol...@gmail.com
> Teléfono: (506) 8706 - 4662
> Institutional website: ICOMVIS
> <http://www.icomvis.una.ac.cr/index.php/manuel>
> Blog sobre Ciencia de Datos: https://mspinola-ciencia-de-datos.netlify.app
>
>
>

-- 
*Manuel Spínola, Ph.D.*
Instituto Internacional en Conservación y Manejo de Vida Silvestre
Universidad Nacional
Apartado 1350-3000
Heredia
COSTA RICA
mspin...@una.cr 
mspinol...@gmail.com
Teléfono: (506) 8706 - 4662
Institutional website: ICOMVIS
<http://www.icomvis.una.ac.cr/index.php/manuel>
Blog sobre Ciencia de Datos: https://mspinola-ciencia-de-datos.netlify.app

[[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] geodata package: CMIP6 climate model data downloading error

2023-01-25 Thread Manuel Spínola
Thank you very much Edzer.

El mié, 25 ene 2023 a las 9:00, Edzer Pebesma (<
edzer.pebe...@uni-muenster.de>) escribió:

>
>
> On 25/01/2023 15:48, Manuel Spínola wrote:
> > Thank you very much Ákos.
> >
> > It didn't work either.
> >
> > Is there any other package that allows to download future climate change
> > scenarios?
>
> CMIP6 data is being uploaded as Zarr files on the google cloud; a blog
> post that gives examples of downloading some parts of it, using packages
> stars and sf, is here:
> https://r-spatial.org/r/2022/09/13/zarr.html
>
> >
> > Manuel
> >
> >
> >
> > El mié, 25 ene 2023 a las 1:27, Bede-Fazekas Ákos ( >)
> > escribió:
> >
> >> Dear Manuel,
> >>
> >> There are some broken links in the WorldClim website. If you find one,
> >> you can write to i...@worldclim.org. Although I have negative
> >> experiences, you should try this way.
> >> Anyway, the global, non-tiled raster can be downloaded from this link:
> >>
> >>
> https://geodata.ucdavis.edu/cmip6/30s/ACCESS-CM2/ssp126/wc2.1_30s_bioc_ACCESS-CM2_ssp126_2021-2040.tif
> >>
> >> Have a nice week,
> >> Ákos
> >>
> >> _
> >> Ákos Bede-Fazekas
> >> Centre for Ecological Research, Hungary
> >>
> >> 2023.01.24. 23:29 keltezéssel, Manuel Spínola írta:
> >>> Dear list members,
> >>>
> >>> I am trying to download CMIP6 climate model data using the R package
> >>> geodata but I got this error message:
> >>>
> >>> bio <- cmip6_tile(lon = -84, lat = 10,"ACCESS-CM2", "126", "2021-2040",
> >>> var="bioc", path = "climate_ckange")
> >>> trying URL '
> >>>
> >>
> https://geodata.ucdavis.edu/cmip6/tiles/ACCESS-CM2/ssp126/wc2.1_30s_bioc_ACCESS-CM2_ssp126_2021-2040_tile-28.tif
> >>> '
> >>> Error in utils::download.file(url = url, destfile = filename, quiet =
> >>> quiet,  :
> >>> cannot open URL '
> >>>
> >>
> https://geodata.ucdavis.edu/cmip6/tiles/ACCESS-CM2/ssp126/wc2.1_30s_bioc_ACCESS-CM2_ssp126_2021-2040_tile-28.tif
> >>> '
> >>> download failed
> >>>
> >>> I cannot even download the data using the worldclim website.
> >>>
> >>>
> >>
> >> ___
> >> 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
>


-- 
*Manuel Spínola, Ph.D.*
Instituto Internacional en Conservación y Manejo de Vida Silvestre
Universidad Nacional
Apartado 1350-3000
Heredia
COSTA RICA
mspin...@una.cr 
mspinol...@gmail.com
Teléfono: (506) 8706 - 4662
Institutional website: ICOMVIS
<http://www.icomvis.una.ac.cr/index.php/manuel>
Blog sobre Ciencia de Datos: https://mspinola-ciencia-de-datos.netlify.app

[[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] geodata package: CMIP6 climate model data downloading error

2023-01-25 Thread Manuel Spínola
Thank you very much Ákos.

It didn't work either.

Is there any other package that allows to download future climate change
scenarios?

Manuel



El mié, 25 ene 2023 a las 1:27, Bede-Fazekas Ákos ()
escribió:

> Dear Manuel,
>
> There are some broken links in the WorldClim website. If you find one,
> you can write to i...@worldclim.org. Although I have negative
> experiences, you should try this way.
> Anyway, the global, non-tiled raster can be downloaded from this link:
>
> https://geodata.ucdavis.edu/cmip6/30s/ACCESS-CM2/ssp126/wc2.1_30s_bioc_ACCESS-CM2_ssp126_2021-2040.tif
>
> Have a nice week,
> Ákos
>
> _
> Ákos Bede-Fazekas
> Centre for Ecological Research, Hungary
>
> 2023.01.24. 23:29 keltezéssel, Manuel Spínola írta:
> > Dear list members,
> >
> > I am trying to download CMIP6 climate model data using the R package
> > geodata but I got this error message:
> >
> > bio <- cmip6_tile(lon = -84, lat = 10,"ACCESS-CM2", "126", "2021-2040",
> > var="bioc", path = "climate_ckange")
> > trying URL '
> >
> https://geodata.ucdavis.edu/cmip6/tiles/ACCESS-CM2/ssp126/wc2.1_30s_bioc_ACCESS-CM2_ssp126_2021-2040_tile-28.tif
> > '
> > Error in utils::download.file(url = url, destfile = filename, quiet =
> > quiet,  :
> >cannot open URL '
> >
> https://geodata.ucdavis.edu/cmip6/tiles/ACCESS-CM2/ssp126/wc2.1_30s_bioc_ACCESS-CM2_ssp126_2021-2040_tile-28.tif
> > '
> > download failed
> >
> > I cannot even download the data using the worldclim website.
> >
> >
>
> ___
> R-sig-Geo mailing list
> R-sig-Geo@r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>


-- 
*Manuel Spínola, Ph.D.*
Instituto Internacional en Conservación y Manejo de Vida Silvestre
Universidad Nacional
Apartado 1350-3000
Heredia
COSTA RICA
mspin...@una.cr 
mspinol...@gmail.com
Teléfono: (506) 8706 - 4662
Institutional website: ICOMVIS
<http://www.icomvis.una.ac.cr/index.php/manuel>
Blog sobre Ciencia de Datos: https://mspinola-ciencia-de-datos.netlify.app

[[alternative HTML version deleted]]

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


[R-sig-Geo] geodata package: CMIP6 climate model data downloading error

2023-01-24 Thread Manuel Spínola
Dear list members,

I am trying to download CMIP6 climate model data using the R package
geodata but I got this error message:

bio <- cmip6_tile(lon = -84, lat = 10,"ACCESS-CM2", "126", "2021-2040",
var="bioc", path = "climate_ckange")
trying URL '
https://geodata.ucdavis.edu/cmip6/tiles/ACCESS-CM2/ssp126/wc2.1_30s_bioc_ACCESS-CM2_ssp126_2021-2040_tile-28.tif
'
Error in utils::download.file(url = url, destfile = filename, quiet =
quiet,  :
  cannot open URL '
https://geodata.ucdavis.edu/cmip6/tiles/ACCESS-CM2/ssp126/wc2.1_30s_bioc_ACCESS-CM2_ssp126_2021-2040_tile-28.tif
'
download failed

I cannot even download the data using the worldclim website.


-- 
*Manuel Spínola, Ph.D.*
Instituto Internacional en Conservación y Manejo de Vida Silvestre
Universidad Nacional
Apartado 1350-3000
Heredia
COSTA RICA
mspin...@una.cr 
mspinol...@gmail.com
Teléfono: (506) 8706 - 4662
Institutional website: ICOMVIS
<http://www.icomvis.una.ac.cr/index.php/manuel>
Blog sobre Ciencia de Datos: https://mspinola-ciencia-de-datos.netlify.app

[[alternative HTML version deleted]]

___
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 use st_rasterize (stars) for a categorical field like terra does?

2022-09-30 Thread Manuel Spínola
Dear list members,

When using the terra package:

f <- system.file("ex/lux.shp", package="terra")
v <- vect(f)
r <- rast(v, ncols=75, nrows=100)
z <- rasterize(v, r, "NAME_2")
plot(z)
lines(v)

How can I obtain the same result using st_rasterize from stars?

Manuel

-- 
*Manuel Spínola, Ph.D.*
Instituto Internacional en Conservación y Manejo de Vida Silvestre
Universidad Nacional
Apartado 1350-3000
Heredia
COSTA RICA
mspin...@una.cr 
mspinol...@gmail.com
Teléfono: (506) 8706 - 4662
Institutional website: ICOMVIS
<http://www.icomvis.una.ac.cr/index.php/manuel>
Blog sobre Ciencia de Datos: https://mspinola-ciencia-de-datos.netlify.app

[[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 filter a spatial object in sf

2021-06-30 Thread Manuel Spínola
Thank you very much Matt.

Manuel

El mié, 30 jun 2021 a las 9:08, Matt Lewis () escribió:

> Dear Manuel,
>
> st_filter by default takes .predicate = st_intersects. The 3 polygons you
> filter to are adjacent to five others, so st_filter returns the 3 you want
> and the 5 others which touch too. To avoid this behaviour you can specify
> the .predicate argument to another option like st_within as in:
>
> nc_filter <- st_filter(nc, nc_smaller, .predicate = st_within)
>
> Hope this helps.
>
> All the best,
>
> Matt
>
> On 2021-06-30 16:52, Manuel Spínola wrote:
>
> I would like to retain the information stored in a larger spatial object
> for a subset of features from a smaller spatial object.  I tried a
> st_filter but I cannot achieve my goal.
>
> nc = st_read(system.file("shape/nc.shp", package="sf"))
>
> nc_smaller <- nc %>% filter(CNTY_ID %in% c(1825, 1827, 1828))
>
> nc_filter <- st_filter(nc, nc_smaller)
>
> The nc_smaller has 3 features, but the nc_filter ended with 8 features.  I
> was expecting to have on 3 features in the nc_filter.
>
>
>
> Manuel
>
>
>
>
>
> --
> *Manuel Spínola, Ph.D.*
> Instituto Internacional en Conservación y Manejo de Vida Silvestre
> Universidad Nacional
> Apartado 1350-3000
> Heredia
> COSTA RICA
> mspin...@una.cr 
> mspinol...@gmail.com
> Teléfono: (506) 8706 - 4662
> Personal website: Lobito de río <
> https://sites.google.com/site/lobitoderio/>
> Institutional website: ICOMVIS <http://www.icomvis.una.ac.cr/>
>
> [[alternative HTML version deleted]]
>
> ___
> R-sig-Geo mailing list
> R-sig-Geo@r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>
>
>


-- 
*Manuel Spínola, Ph.D.*
Instituto Internacional en Conservación y Manejo de Vida Silvestre
Universidad Nacional
Apartado 1350-3000
Heredia
COSTA RICA
mspin...@una.cr 
mspinol...@gmail.com
Teléfono: (506) 8706 - 4662
Personal website: Lobito de río <https://sites.google.com/site/lobitoderio/>
Institutional website: ICOMVIS <http://www.icomvis.una.ac.cr/>

[[alternative HTML version deleted]]

___
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 filter a spatial object in sf

2021-06-30 Thread Manuel Spínola
I would like to retain the information stored in a larger spatial object
for a subset of features from a smaller spatial object.  I tried a
st_filter but I cannot achieve my goal.

nc = st_read(system.file("shape/nc.shp", package="sf"))

nc_smaller <- nc %>% filter(CNTY_ID %in% c(1825, 1827, 1828))

nc_filter <- st_filter(nc, nc_smaller)

The nc_smaller has 3 features, but the nc_filter ended with 8 features.  I
was expecting to have on 3 features in the nc_filter.



Manuel





-- 
*Manuel Spínola, Ph.D.*
Instituto Internacional en Conservación y Manejo de Vida Silvestre
Universidad Nacional
Apartado 1350-3000
Heredia
COSTA RICA
mspin...@una.cr 
mspinol...@gmail.com
Teléfono: (506) 8706 - 4662
Personal website: Lobito de río <https://sites.google.com/site/lobitoderio/>
Institutional website: ICOMVIS <http://www.icomvis.una.ac.cr/>

[[alternative HTML version deleted]]

___
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 avoid that st_intersection drop the empty polygons that do not intersect the other layer?

2021-06-23 Thread Manuel Spínola
Dear list members,

I am trying to calculate the road density in a grid of hexagons.

roads_hex <- st_intersection(vias, hex_cr_dm) %>%
  dplyr::mutate(len_m = sf::st_length(geom)) %>% # Find the length of each
line
  dplyr::group_by(hexagono) %>% # Here you need to insert all the columns
from your shapes
  dplyr::summarize(len_m = sum(len_m))

but the grid has 613 features and the final object has 556 because some of
the hexagons do not have roads inside.

How can I keep the 615 hexagons in the final object even those one having a
value of 0 road?


-- 
*Manuel Spínola, Ph.D.*
Instituto Internacional en Conservación y Manejo de Vida Silvestre
Universidad Nacional
Apartado 1350-3000
Heredia
COSTA RICA
mspin...@una.cr 
mspinol...@gmail.com
Teléfono: (506) 8706 - 4662
Personal website: Lobito de río <https://sites.google.com/site/lobitoderio/>
Institutional website: ICOMVIS <http://www.icomvis.una.ac.cr/>

[[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] stars st_transform gives NA to the offset and delta parameters

2021-06-07 Thread Manuel Spínola
Thank you very much Edzer,

I am working with a raster file of land cover from the Copernicus Global
Land Service that is 100m resolution but the file is in a regular
latitude/longitude grid (EPSG:4326).

How can I project this file to UTM keeping the 100m resolution?

You told me to go with st_warp but when I did that I got the following
error.

raster_utm <- st_warp(land_cover, crs = 5367)

Error in matrix(seq_len(prod(dims[dxy])), dims[dxy[1]], dims[dxy[2]])[xy] :
subscript out of bounds


I am missing an argument?

How can I specify the target grid template?

Manuel

El lun, 7 jun 2021 a las 1:02, Edzer Pebesma ()
escribió:

>
>
> On 07/06/2021 01:16, Manuel Spínola wrote:
> > Dear list members,
> >
> > When using st_transform in a stars object the offset and delta parameters
> > become NA, is this an expected behavior?
>
> Yes, it also says that you got a curvilinear grid as a result, which is
> a grid with non-constant cell size (delta) and non-constant coordinate
> of the side (offset); see
> https://keen-swartz-3146c4.netlify.app/intro.html#raster-types
>
> If you want a regular grid in the new CRS, use st_warp(), preferably
> with the target grid template.
>
> >
> >
> > geomatrix = system.file("tif/geomatrix.tif", package = "stars")
> > x = read_stars(geomatrix)
> >
> > new = st_crs(4326)
> > y = st_transform(x, new)
> > y
> >
> >
> >
> >
> > *Manuel Spínola, Ph.D.*
> > Instituto Internacional en Conservación y Manejo de Vida Silvestre
> > Universidad Nacional
> > Apartado 1350-3000
> > Heredia
> > COSTA RICA
> > mspin...@una.cr 
> > mspinol...@gmail.com
> > Teléfono: (506) 8706 - 4662
> > Personal website: Lobito de río <
> https://sites.google.com/site/lobitoderio/>
> > Institutional website: ICOMVIS <http://www.icomvis.una.ac.cr/>
> >
> >   [[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
>


-- 
*Manuel Spínola, Ph.D.*
Instituto Internacional en Conservación y Manejo de Vida Silvestre
Universidad Nacional
Apartado 1350-3000
Heredia
COSTA RICA
mspin...@una.cr 
mspinol...@gmail.com
Teléfono: (506) 8706 - 4662
Personal website: Lobito de río <https://sites.google.com/site/lobitoderio/>
Institutional website: ICOMVIS <http://www.icomvis.una.ac.cr/>

[[alternative HTML version deleted]]

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


[R-sig-Geo] stars st_transform gives NA to the offset and delta parameters

2021-06-06 Thread Manuel Spínola
Dear list members,

When using st_transform in a stars object the offset and delta parameters
become NA, is this an expected behavior?


geomatrix = system.file("tif/geomatrix.tif", package = "stars")
x = read_stars(geomatrix)

new = st_crs(4326)
y = st_transform(x, new)
y




*Manuel Spínola, Ph.D.*
Instituto Internacional en Conservación y Manejo de Vida Silvestre
Universidad Nacional
Apartado 1350-3000
Heredia
COSTA RICA
mspin...@una.cr 
mspinol...@gmail.com
Teléfono: (506) 8706 - 4662
Personal website: Lobito de río <https://sites.google.com/site/lobitoderio/>
Institutional website: ICOMVIS <http://www.icomvis.una.ac.cr/>

[[alternative HTML version deleted]]

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


[R-sig-Geo] landmap package, cannot get the model error following the binomial variable example

2021-06-05 Thread Manuel Spínola
Dear list members,

I am fitting a model using the package landmap but I cannot get the model
error for the binomial variable example of the package.

data(eberg_grid)
gridded(eberg_grid) <- ~x+y
proj4string(eberg_grid) <- CRS("+init=epsg:31467")

data(eberg)
eb.s <- sample.int(nrow(eberg), 1400)
eberg <- eberg[eb.s,]
coordinates(eberg) <- ~X+Y
proj4string(eberg) <- CRS("+init=epsg:31467")

eberg$Parabraunerde <- ifelse(eberg$TAXGRSC=="Parabraunerde", 1, 0)

X <- eberg_grid[c("PRMGEO6","DEMSRT6","TWISRT6","TIRAST6")]

mB <- train.spLearner(eberg["Parabraunerde"], covariates=X,
   family=binomial(), cov.model = "nugget", parallel=FALSE)

eberg.Parabraunerde <- predict(mB)

eberg.Parabraunerde$pred


-- 
*Manuel Spínola, Ph.D.*
Instituto Internacional en Conservación y Manejo de Vida Silvestre
Universidad Nacional
Apartado 1350-3000
Heredia
COSTA RICA
mspin...@una.cr 
mspinol...@gmail.com
Teléfono: (506) 8706 - 4662
Personal website: Lobito de río <https://sites.google.com/site/lobitoderio/>
Institutional website: ICOMVIS <http://www.icomvis.una.ac.cr/>

[[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] Using facet_wrap with geom_stars for a stacked raster

2021-06-01 Thread Manuel Spínola
Thank you very much Edzer.


El mar, 1 jun 2021 a las 11:59, Edzer Pebesma (<
edzer.pebe...@uni-muenster.de>) escribió:

>
>
>
> On 01/06/2021 19:15, Manuel Spínola wrote:
> > Thank you very much Edzer.
> >
> > What about the labels of the stripes?
> >
> > If I try to change the labels, they come out as NA
> >
> > r <- read_stars(system.file("external/test.grd", package="raster"))
> >
> > s1 <- c(r, r*2)
> >
> > s2 <- merge(s1)
> >
> > n <- c("raster 01", "raster 02")
> >
> > ggplot() +
> > geom_stars(data = s2) +
> > facet_wrap(~attributes, labeller = labeller(attributes = n)) +
> > coord_equal()
> >
>
> s3 = st_set_dimensions(s2, "attributes",
>values = c("label_A", "label_B"))
> ggplot() + geom_stars(data = s3) +
>facet_wrap(~attributes) + coord_equal()
>
> >
> > El mar, 1 jun 2021 a las 10:54, Edzer Pebesma
> > (mailto:edzer.pebe...@uni-muenster.de>>)
>
> > escribió:
> >
> >
> >
> > On 01/06/2021 18:43, Manuel Spínola wrote:
> >  > Dear list members,
> >  >
> >  > I am trying to use facet_wrap with geom_stars but I don't know
> how to
> >  > specify the variable argument in the facet_wrap function (I know
> > is not
> >  > "band"), and also, how to change the labels of the strip names?
> >  >
> >  > r <- read_stars(system.file("external/test.grd",
> package="raster"))
> >  >
> >  > s1 <- c(r, r*2)
> >  >
> >  > ggplot() +
> >  >geom_stars(data = s1) +
> >  >coord_equal() +
> >  >facet_wrap(~ band)
> >  >
> >
> > Try:
> >
> > ggplot() +
> > geom_stars(data = merge(s1)) + f
> > facet_wrap(~attributes) +
> > coord_equal()
> >
> >
> > c() binds attributes, merge() merges them into a dimension.
> > --
> > 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 <mailto:R-sig-Geo@r-project.org>
> > https://stat.ethz.ch/mailman/listinfo/r-sig-geo
> > <https://stat.ethz.ch/mailman/listinfo/r-sig-geo>
> >
> >
> >
> > --
> > *Manuel Spínola, Ph.D.*
> > Instituto Internacional en Conservación y Manejo de Vida Silvestre
> > Universidad Nacional
> > Apartado 1350-3000
> > Heredia
> > COSTA RICA
> > mspin...@una.cr <mailto:mspin...@una.ac.cr>
> > mspinol...@gmail.com <mailto:mspinol...@gmail.com>
> > Teléfono: (506) 8706 - 4662
> > Personal website: Lobito de río
> > <https://sites.google.com/site/lobitoderio/>
> > Institutional website: ICOMVIS <http://www.icomvis.una.ac.cr/>
>
> --
> Edzer Pebesma
> Institute for Geoinformatics
> Heisenbergstrasse 2, 48151 Muenster, Germany
> Phone: +49 251 8333081
>


-- 
*Manuel Spínola, Ph.D.*
Instituto Internacional en Conservación y Manejo de Vida Silvestre
Universidad Nacional
Apartado 1350-3000
Heredia
COSTA RICA
mspin...@una.cr 
mspinol...@gmail.com
Teléfono: (506) 8706 - 4662
Personal website: Lobito de río <https://sites.google.com/site/lobitoderio/>
Institutional website: ICOMVIS <http://www.icomvis.una.ac.cr/>

[[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] Using facet_wrap with geom_stars for a stacked raster

2021-06-01 Thread Manuel Spínola
Thank you very much Edzer.

What about the labels of the stripes?

If I try to change the labels, they come out as NA

r <- read_stars(system.file("external/test.grd", package="raster"))

s1 <- c(r, r*2)

s2 <- merge(s1)

n <- c("raster 01", "raster 02")

ggplot() +
   geom_stars(data = s2) +
   facet_wrap(~attributes, labeller = labeller(attributes = n)) +
   coord_equal()


El mar, 1 jun 2021 a las 10:54, Edzer Pebesma (<
edzer.pebe...@uni-muenster.de>) escribió:

>
>
> On 01/06/2021 18:43, Manuel Spínola wrote:
> > Dear list members,
> >
> > I am trying to use facet_wrap with geom_stars but I don't know how to
> > specify the variable argument in the facet_wrap function (I know is not
> > "band"), and also, how to change the labels of the strip names?
> >
> > r <- read_stars(system.file("external/test.grd", package="raster"))
> >
> > s1 <- c(r, r*2)
> >
> > ggplot() +
> >geom_stars(data = s1) +
> >coord_equal() +
> >facet_wrap(~ band)
> >
>
> Try:
>
> ggplot() +
>geom_stars(data = merge(s1)) + f
>facet_wrap(~attributes) +
>coord_equal()
>
>
> c() binds attributes, merge() merges them into a dimension.
> --
> 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
>


-- 
*Manuel Spínola, Ph.D.*
Instituto Internacional en Conservación y Manejo de Vida Silvestre
Universidad Nacional
Apartado 1350-3000
Heredia
COSTA RICA
mspin...@una.cr 
mspinol...@gmail.com
Teléfono: (506) 8706 - 4662
Personal website: Lobito de río <https://sites.google.com/site/lobitoderio/>
Institutional website: ICOMVIS <http://www.icomvis.una.ac.cr/>

[[alternative HTML version deleted]]

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


[R-sig-Geo] Using facet_wrap with geom_stars for a stacked raster

2021-06-01 Thread Manuel Spínola
Dear list members,

I am trying to use facet_wrap with geom_stars but I don't know how to
specify the variable argument in the facet_wrap function (I know is not
"band"), and also, how to change the labels of the strip names?

r <- read_stars(system.file("external/test.grd", package="raster"))

s1 <- c(r, r*2)

ggplot() +
  geom_stars(data = s1) +
  coord_equal() +
  facet_wrap(~ band)

-- 
*Manuel Spínola, Ph.D.*
Instituto Internacional en Conservación y Manejo de Vida Silvestre
Universidad Nacional
Apartado 1350-3000
Heredia
COSTA RICA
mspin...@una.cr 
mspinol...@gmail.com
Teléfono: (506) 8706 - 4662
Personal website: Lobito de río <https://sites.google.com/site/lobitoderio/>
Institutional website: ICOMVIS <http://www.icomvis.una.ac.cr/>

[[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] R crashes when reading geopackage files with st_read (sf package) in macOS

2021-03-31 Thread Manuel Spínola
Thank you very much Roger.

I can read shapefile without any problem with st_read.

I think it works for both versions, but definitely is working with the
binary version.

How can I work around the problem with libsqlite3?

How can I install the GDAL, PROJ and GEOS without being from source?

Best,

Manuel


El mié, 31 mar 2021 a las 13:07, Roger Bivand ()
escribió:

> On Wed, 31 Mar 2021, Manuel Spínola wrote:
>
> > Thank you very much Roger.
> >
> > I reinstalled the sf and rgdal packages from binaries and the problem
> > persisted.
>
> This must be either because you did not remove all of the traces of the
> previous attempts. If sf failed, then
> https://cran.r-project.org/web/checks/check_results_sf.html
> would show errors for MacOS.
>
> >
> > To install GDAL, PROJ and GEOS i followed the instructions in the sf
> github
> > site.
>
> Please avoid installing the source package unless there is functionality
> not provided by the CRAN binary.
>
> >
> > Yes, the problem is with several geopackages files.  I see the problem
> also
> > with st_write when working trying to save a file in geopackage format.
> >
>
> Which other drivers are affected - if only GPKG, then libsqlite3 is the
> most likely culprit. However, unless you must have facilities only
> available by source install, avoid source installs.
>
> > I can read the files without problem with readOGR.
> >
>
> Installed as the CRAN binary or source?
>
> Roger
>
> > Manuel
> >
> > El mié, 31 mar 2021 a las 10:26, Roger Bivand ()
> > escribió:
> >
> >> Please refer to the associated sf issue on github:
> >> https://github.com/r-spatial/sf/issues/1606 for completeness. Please
> >> confirm that you are not using the MacOS sf CRAN binary package, but
> have
> >> installed GDAL, PROJ and GEOS yourself. Please also confirm that you see
> >> the same error with every GPKG file.
> >>
> >> --
> >> Roger Bivand
> >> Norwegian School of Economics
> >> Postboks 3490 Ytre Sandviken, 5045 Bergen, Norway
> >> roger.biv...@nhh.no
> >>
> >>
> >> 
> >> Fra: R-sig-Geo  på vegne av Manuel
> >> Spínola 
> >> Sendt: onsdag 31. mars 2021 17.55
> >> Til: r-sig-geo
> >> Emne: [R-sig-Geo] R crashes when reading geopackage files with st_read
> (sf
> >> package) in macOS
> >>
> >> Dear list members,
> >>
> >> When reading geopackages files with st_read (sf package) RStudio
> crashes (R
> >> session aborted) in macOS.  Any suggestions to fix this problem?
> >>
> >> Should I ask this question to the macOS group (r-sig-mac)?
> >>
> >> library(sf)
> >> Linking to GEOS 3.9.0, GDAL 3.2.1, PROJ 7.2.1
> >>
> >>
> >> library(spData)
> >>
> >>
> >> world = st_read(system.file("shapes/world.gpkg", package = "spData"))
> >>
> >>
> >>
> >>
> >> --
> >> *Manuel Spínola, Ph.D.*
> >> Instituto Internacional en Conservación y Manejo de Vida Silvestre
> >> Universidad Nacional
> >> Apartado 1350-3000
> >> Heredia
> >> COSTA RICA
> >> mspin...@una.cr 
> >> mspinol...@gmail.com
> >> Teléfono: (506) 8706 - 4662
> >> Personal website: Lobito de río <
> >> https://sites.google.com/site/lobitoderio/>
> >> Institutional website: ICOMVIS <http://www.icomvis.una.ac.cr/>
> >>
> >> [[alternative HTML version deleted]]
> >>
> >> ___
> >> R-sig-Geo mailing list
> >> R-sig-Geo@r-project.org
> >> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
> >>
> >
> >
> >
>
> --
> Roger Bivand
> Department of Economics, Norwegian School of Economics,
> Postboks 3490 Ytre Sandviken, 5045 Bergen, Norway.
> e-mail: roger.biv...@nhh.no
> https://orcid.org/-0003-2392-6140
> https://scholar.google.no/citations?user=AWeghB0J=en



-- 
*Manuel Spínola, Ph.D.*
Instituto Internacional en Conservación y Manejo de Vida Silvestre
Universidad Nacional
Apartado 1350-3000
Heredia
COSTA RICA
mspin...@una.cr 
mspinol...@gmail.com
Teléfono: (506) 8706 - 4662
Personal website: Lobito de río <https://sites.google.com/site/lobitoderio/>
Institutional website: ICOMVIS <http://www.icomvis.una.ac.cr/>

[[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] R crashes when reading geopackage files with st_read (sf package) in macOS

2021-03-31 Thread Manuel Spínola
Thank you very much Roger.

I reinstalled the sf and rgdal packages from binaries and the problem
persisted.

To install GDAL, PROJ and GEOS i followed the instructions in the sf github
site.

Yes, the problem is with several geopackages files.  I see the problem also
with st_write when working trying to save a file in geopackage format.

I can read the files without problem with readOGR.

Manuel

El mié, 31 mar 2021 a las 10:26, Roger Bivand ()
escribió:

> Please refer to the associated sf issue on github:
> https://github.com/r-spatial/sf/issues/1606 for completeness. Please
> confirm that you are not using the MacOS sf CRAN binary package, but have
> installed GDAL, PROJ and GEOS yourself. Please also confirm that you see
> the same error with every GPKG file.
>
> --
> Roger Bivand
> Norwegian School of Economics
> Postboks 3490 Ytre Sandviken, 5045 Bergen, Norway
> roger.biv...@nhh.no
>
>
> ________
> Fra: R-sig-Geo  på vegne av Manuel
> Spínola 
> Sendt: onsdag 31. mars 2021 17.55
> Til: r-sig-geo
> Emne: [R-sig-Geo] R crashes when reading geopackage files with st_read (sf
> package) in macOS
>
> Dear list members,
>
> When reading geopackages files with st_read (sf package) RStudio crashes (R
> session aborted) in macOS.  Any suggestions to fix this problem?
>
> Should I ask this question to the macOS group (r-sig-mac)?
>
> library(sf)
> Linking to GEOS 3.9.0, GDAL 3.2.1, PROJ 7.2.1
>
>
> library(spData)
>
>
> world = st_read(system.file("shapes/world.gpkg", package = "spData"))
>
>
>
>
> --
> *Manuel Spínola, Ph.D.*
> Instituto Internacional en Conservación y Manejo de Vida Silvestre
> Universidad Nacional
> Apartado 1350-3000
> Heredia
> COSTA RICA
> mspin...@una.cr 
> mspinol...@gmail.com
> Teléfono: (506) 8706 - 4662
> Personal website: Lobito de río <
> https://sites.google.com/site/lobitoderio/>
> Institutional website: ICOMVIS <http://www.icomvis.una.ac.cr/>
>
> [[alternative HTML version deleted]]
>
> ___
> R-sig-Geo mailing list
> R-sig-Geo@r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>


-- 
*Manuel Spínola, Ph.D.*
Instituto Internacional en Conservación y Manejo de Vida Silvestre
Universidad Nacional
Apartado 1350-3000
Heredia
COSTA RICA
mspin...@una.cr 
mspinol...@gmail.com
Teléfono: (506) 8706 - 4662
Personal website: Lobito de río <https://sites.google.com/site/lobitoderio/>
Institutional website: ICOMVIS <http://www.icomvis.una.ac.cr/>

[[alternative HTML version deleted]]

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


[R-sig-Geo] R crashes when reading geopackage files with st_read (sf package) in macOS

2021-03-31 Thread Manuel Spínola
Dear list members,

When reading geopackages files with st_read (sf package) RStudio crashes (R
session aborted) in macOS.  Any suggestions to fix this problem?

Should I ask this question to the macOS group (r-sig-mac)?

library(sf)
Linking to GEOS 3.9.0, GDAL 3.2.1, PROJ 7.2.1


library(spData)


world = st_read(system.file("shapes/world.gpkg", package = "spData"))




-- 
*Manuel Spínola, Ph.D.*
Instituto Internacional en Conservación y Manejo de Vida Silvestre
Universidad Nacional
Apartado 1350-3000
Heredia
COSTA RICA
mspin...@una.cr 
mspinol...@gmail.com
Teléfono: (506) 8706 - 4662
Personal website: Lobito de río <https://sites.google.com/site/lobitoderio/>
Institutional website: ICOMVIS <http://www.icomvis.una.ac.cr/>

[[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] Not perfect match between the bounding box for a EPSG when projected (st_bbox from sf)

2021-03-26 Thread Manuel Spínola
Thank you very much Roger.

Manuel

El vie, 26 mar 2021 a las 8:47, Roger Bivand ()
escribió:

> On Thu, 25 Mar 2021, Manuel Spínola wrote:
>
> > Dear list members,
> >
> > I am working with the epsg 5367.
> >
> > The information for this epsg according to this website (
> > https://epsg.io/5367) is:
> >
> > WGS84 bounds:
> > -90.45 2.15
> > -81.43 11.77
> >
> > Projected bounds:
> > -218963.01 239235.14
> > 780173.56 1302793.77
> >
> > When I create a box with st_bbox from the package sf and transform the
> > object I don't get the same bounding box that I was expecting.  Is it a
> > fair expectation?
>
> No. Firstly, epsg.io is not an EPSG service. Secondly, two different
> definitions are offered. I think that this works (sf 0.9-8):
>
> pts1 <- st_sfc(list(st_point(c(-90.45, 2.15)), st_point(c(-81.43,
>   11.77))), crs="OGC:CRS84")
> st_transform(pts1, "EPSG:5367")
> # POINT (-218962 239233.5)
> # POINT (780173.7 1302793)
> o <- sf_proj_pipelines("OGC:CRS84", "EPSG:5367")
> o$definition
> st_transform(pts1, "EPSG:5367", pipeline = o$definition[1])
> # POINT (-218962 239233.5)
> # POINT (780173.7 1302793)
> # Costa Rica - onshore and offshore, accuracy 1.0 m, code 8969 [grid]
> st_transform(pts1, "EPSG:5367", pipeline = o$definition[2])
> # POINT (-218963 239235.1)
> # POINT (780173.6 1302794)
> # Costa Rica - onshore and offshore, accuracy 1.0 m, code 5376 (default)
> # [grid]
>
> So, as in https://github.com/r-spatial/sf/issues/1634, treating epsg.io
> as
> authoritative (especially when there are different transformation
> pipelines in play) may be unhelpful.sf/PROJ chooses a different pipeline
> as default than epsg.io.
>
> This roundtrips:
>
> st_transform(st_transform(pts1, "EPSG:5367"), "OGC:CRS84")
> # POINT (-90.45 2.15)
> # POINT (-81.43 11.77)
> # Costa Rica - onshore and offshore, accuracy 1.0 m, code 8969 [grid]
>
> but for epsg.io's default, one needs to intervene manually to choose
> pipelines both ways that are not sf's default choices.
>
> Of course, here I am not using the bounding box polygon, because its
> projected version is not a rectangle, so its bounding box expands the
> range, especially further from the equator.
>
> Hope this clarifies,
>
> Roger
>
> >
> > b <- st_bbox(c(xmin = -90.45, xmax = -81.43, ymax = 11.77, ymin = 2.15),
> > crs = st_crs(4326))
> >
> > b <- st_as_sfc(b)
> >
> > b_5367 <- st_transform(b, crs = 5367)
> >
> > b_5367
> >
> > Geometry set for 1 feature
> > Geometry type: POLYGON
> > Dimension: XY
> > Bounding box:  xmin: -218962 ymin: 237951.9 xmax: 785959.7 ymax: 1309622
> > Projected CRS: CR05 / CRTM05POLYGON ((-218962 239233.5, 785959.7
> 237951.9, ...
> >
> >
> >
> >
>
> --
> Roger Bivand
> Department of Economics, Norwegian School of Economics,
> Postboks 3490 Ytre Sandviken, 5045 Bergen, Norway.
> e-mail: roger.biv...@nhh.no
> https://orcid.org/-0003-2392-6140
> https://scholar.google.no/citations?user=AWeghB0J=en



-- 
*Manuel Spínola, Ph.D.*
Instituto Internacional en Conservación y Manejo de Vida Silvestre
Universidad Nacional
Apartado 1350-3000
Heredia
COSTA RICA
mspin...@una.cr 
mspinol...@gmail.com
Teléfono: (506) 8706 - 4662
Personal website: Lobito de río <https://sites.google.com/site/lobitoderio/>
Institutional website: ICOMVIS <http://www.icomvis.una.ac.cr/>

[[alternative HTML version deleted]]

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


[R-sig-Geo] Not perfect match between the bounding box for a EPSG when projected (st_bbox from sf)

2021-03-25 Thread Manuel Spínola
Dear list members,

I am working with the epsg 5367.

The information for this epsg according to this website (
https://epsg.io/5367) is:

WGS84 bounds:
-90.45 2.15
-81.43 11.77

Projected bounds:
-218963.01 239235.14
780173.56 1302793.77

When I create a box with st_bbox from the package sf and transform the
object I don't get the same bounding box that I was expecting.  Is it a
fair expectation?

b <- st_bbox(c(xmin = -90.45, xmax = -81.43, ymax = 11.77, ymin = 2.15),
crs = st_crs(4326))

b <- st_as_sfc(b)

b_5367 <- st_transform(b, crs = 5367)

b_5367

Geometry set for 1 feature
Geometry type: POLYGON
Dimension: XY
Bounding box:  xmin: -218962 ymin: 237951.9 xmax: 785959.7 ymax: 1309622
Projected CRS: CR05 / CRTM05POLYGON ((-218962 239233.5, 785959.7 237951.9, ...



-- 
*Manuel Spínola, Ph.D.*
Instituto Internacional en Conservación y Manejo de Vida Silvestre
Universidad Nacional
Apartado 1350-3000
Heredia
COSTA RICA
mspin...@una.cr 
mspinol...@gmail.com
Teléfono: (506) 8706 - 4662
Personal website: Lobito de río <https://sites.google.com/site/lobitoderio/>
Institutional website: ICOMVIS <http://www.icomvis.una.ac.cr/>

[[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 identify the different discrete classes from a raster of land cover data (tif).

2021-03-02 Thread Manuel Spínola
Thank you very much Ben.  That works.

Manuel









El mar, 2 mar 2021 a las 12:50, Ben Tupper () escribió:

> Hi,
>
> I'm not familiar with the dataset, but I am guessing it is related to how
> the labels are encoded. If that is the case, then it is possible the stored
> class labels are not literally 1-23 but are 23 labels selected from the
> range of 0-255.  You could do a brief check with ...
>
> table(r[])
>
> Cheers,
> Ben
>
>
>
> On Tue, Mar 2, 2021 at 12:15 PM Manuel Spínola 
> wrote:
>
>> Dear list members,
>>
>> I am working with a .tif file from the Copernicus Global Land Service with
>> land cover data.  The file has 23 discrete classes but the raster shows a
>> continuous range of values (0 to 255).
>>
>> r =
>>
>> raster(W100N20_PROBAV_LC100_global_v3.0.1_2019-nrt_Discrete-Classification-map_EPSG-4326.tif)
>>
>> class  : RasterLayer
>> dimensions : 20160, 20160, 406425600  (nrow, ncol, ncell)
>> resolution : 0.0009920635, 0.0009920635  (x, y)
>> extent : -100, -80, 0, 20  (xmin, xmax, ymin, ymax)
>> crs: +proj=longlat +datum=WGS84 +no_defs
>> source :
>> /Users/manuelspinola/Documents/01-Manolo/R_OVS_material/landscape_ecology/datos_copernicus/W100N20_PROBAV_LC100_global_v3.0.1_2019-nrt_Discrete-Classification-map_EPSG-4326.tif
>> names  :
>> W100N20_PROBAV_LC100_global_v3.0.1_2019.nrt_Discrete.Classification.map_EPSG.4326
>> values : 0, 255  (min, max)
>>
>>
>>
>> How can I recognize the different discrete classes included in the raster
>> representing each land cover type.
>>
>> Manuel
>>
>>
>> --
>> *Manuel Spínola, Ph.D.*
>> Instituto Internacional en Conservación y Manejo de Vida Silvestre
>> Universidad Nacional
>> Apartado 1350-3000
>> Heredia
>> COSTA RICA
>> mspin...@una.cr 
>> mspinol...@gmail.com
>> Teléfono: (506) 8706 - 4662
>> Personal website: Lobito de río <
>> https://sites.google.com/site/lobitoderio/>
>> Institutional website: ICOMVIS <http://www.icomvis.una.ac.cr/>
>>
>> [[alternative HTML version deleted]]
>>
>> ___
>> R-sig-Geo mailing list
>> R-sig-Geo@r-project.org
>> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>>
>
>
> --
> Ben Tupper
> Bigelow Laboratory for Ocean Science
> East Boothbay, Maine
> http://www.bigelow.org/
> https://eco.bigelow.org
>
>

-- 
*Manuel Spínola, Ph.D.*
Instituto Internacional en Conservación y Manejo de Vida Silvestre
Universidad Nacional
Apartado 1350-3000
Heredia
COSTA RICA
mspin...@una.cr 
mspinol...@gmail.com
Teléfono: (506) 8706 - 4662
Personal website: Lobito de río <https://sites.google.com/site/lobitoderio/>
Institutional website: ICOMVIS <http://www.icomvis.una.ac.cr/>

[[alternative HTML version deleted]]

___
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 identify the different discrete classes from a raster of land cover data (tif).

2021-03-02 Thread Manuel Spínola
Dear list members,

I am working with a .tif file from the Copernicus Global Land Service with
land cover data.  The file has 23 discrete classes but the raster shows a
continuous range of values (0 to 255).

r =
raster(W100N20_PROBAV_LC100_global_v3.0.1_2019-nrt_Discrete-Classification-map_EPSG-4326.tif)

class  : RasterLayer
dimensions : 20160, 20160, 406425600  (nrow, ncol, ncell)
resolution : 0.0009920635, 0.0009920635  (x, y)
extent : -100, -80, 0, 20  (xmin, xmax, ymin, ymax)
crs: +proj=longlat +datum=WGS84 +no_defs
source : 
/Users/manuelspinola/Documents/01-Manolo/R_OVS_material/landscape_ecology/datos_copernicus/W100N20_PROBAV_LC100_global_v3.0.1_2019-nrt_Discrete-Classification-map_EPSG-4326.tif
names  : 
W100N20_PROBAV_LC100_global_v3.0.1_2019.nrt_Discrete.Classification.map_EPSG.4326
values : 0, 255  (min, max)



How can I recognize the different discrete classes included in the raster
representing each land cover type.

Manuel


-- 
*Manuel Spínola, Ph.D.*
Instituto Internacional en Conservación y Manejo de Vida Silvestre
Universidad Nacional
Apartado 1350-3000
Heredia
COSTA RICA
mspin...@una.cr 
mspinol...@gmail.com
Teléfono: (506) 8706 - 4662
Personal website: Lobito de río <https://sites.google.com/site/lobitoderio/>
Institutional website: ICOMVIS <http://www.icomvis.una.ac.cr/>

[[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] Species distribution modeling with presence-only data using log-Gaussian Cox process

2021-02-11 Thread Manuel Spínola
Thank you Adrian,

I will take a look at that function.

Manuel

El mié, 10 feb 2021 a las 20:16, Adrian Baddeley (<
adrian.badde...@curtin.edu.au>) escribió:

> Manuel_Spinola  writes:
>
> > I would like to know of any R package that can be used for modeling
> species
> > distribution with presence-only data using log-Gaussian Cox process.
>
> The 'spatstat' package fits these models using the function 'kppm'
> Example:
> fit <- kppm(X ~ terms, clusters="LGCP")
> See the help for function 'kppm'.
>
> It is also extensively documented in Chapter 12 of the spatstat book (
> book.spatstat.org)
>
> Adrian Baddeley
>


-- 
*Manuel Spínola, Ph.D.*
Instituto Internacional en Conservación y Manejo de Vida Silvestre
Universidad Nacional
Apartado 1350-3000
Heredia
COSTA RICA
mspin...@una.cr 
mspinol...@gmail.com
Teléfono: (506) 8706 - 4662
Personal website: Lobito de río <https://sites.google.com/site/lobitoderio/>
Institutional website: ICOMVIS <http://www.icomvis.una.ac.cr/>

[[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] Species distribution modeling with presence-only data using log-Gaussian Cox process

2021-02-11 Thread Manuel Spínola
Thank you very much Barry, I will take a look at that.

El mié, 10 feb 2021 a las 10:41, Barry Rowlingson ()
escribió:

> Before messing with lgcp I'd look at spatstat - lgcp is more intended for
> relative risk calculations where you have "cases" and "controls", and also
> for
> space-time data.
>
> spatstat seems to have functions for fitting (and simulating) LGCPs to
> point patterns so I think that might be what you are after...
>
> Barry
>
>
> On Tue, Feb 9, 2021 at 8:18 PM Edzer Pebesma <
> edzer.pebe...@uni-muenster.de> wrote:
>
>> A  way out of this may be to make a local copy of the lgcp sources,
>> remove the rpanel dependency from DESCRIPTION, and install it from
>> there. You won't get the functions that need rpanel, but those might not
>> be essential.
>>
>> On 09/02/2021 20:09, Manuel Spínola wrote:
>> > Thank you very much Edzer.
>> >
>> > I tried to install lgcp, but I got an error message regarding BWidget.
>> > I think that Bwidget is an external software and I don't know how to
>> > install it in MacOS (Big Sur 11.2).
>> >
>> > Manuel
>> >
>> > This is the error that I get when trying to install lgcp in R 4.0.3:
>> >
>> > xcrun: error: invalid active developer path
>> > (/Library/Developer/CommandLineTools), missing xcrun at:
>> > /Library/Developer/CommandLineTools/usr/bin/xcrun
>> > Warning message:
>> > In system2("/usr/bin/otool", c("-L", shQuote(DSO)), stdout = TRUE) :
>> >running command ''/usr/bin/otool' -L
>> >
>> '/Library/Frameworks/R.framework/Resources/library/tcltk/libs//tcltk.so''
>> had
>> > status 1
>> > Error in structure(.External(.C_dotTcl, ...), class = "tclObj") :
>> >[tcl] can't find package BWidget.
>> >
>> > Error: unable to load R code in package ‘rpanel’
>> > Execution halted
>> >
>> > El mar, 9 feb 2021 a las 12:51, Edzer Pebesma
>> > (mailto:edzer.pebe...@uni-muenster.de>>)
>>
>> > escribió:
>> >
>> > Have you tried package lgcp?
>> >
>> > On 09/02/2021 17:26, Manuel Spínola wrote:
>> >  > Dear list members,
>> >  >
>> >      > I would like to know of any R package that can be used for
>> > modeling species
>> >  > distribution with presence-only data using log-Gaussian Cox
>> process.
>> >  >
>> >  > Manuel
>> >  >
>> >
>> > ___
>> > R-sig-Geo mailing list
>> > R-sig-Geo@r-project.org <mailto:R-sig-Geo@r-project.org>
>> > https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>> >
>> >
>> >
>> > --
>> > *Manuel Spínola, Ph.D.*
>> > Instituto Internacional en Conservación y Manejo de Vida Silvestre
>> > Universidad Nacional
>> > Apartado 1350-3000
>> > Heredia
>> > COSTA RICA
>> > mspin...@una.cr <mailto:mspin...@una.ac.cr>
>> > mspinol...@gmail.com <mailto:mspinol...@gmail.com>
>> > Teléfono: (506) 8706 - 4662
>> > Personal website: Lobito de río
>> > <https://sites.google.com/site/lobitoderio/>
>> > Institutional website: ICOMVIS <http://www.icomvis.una.ac.cr/>
>>
>> ___
>> R-sig-Geo mailing list
>> R-sig-Geo@r-project.org
>> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>>
>

-- 
*Manuel Spínola, Ph.D.*
Instituto Internacional en Conservación y Manejo de Vida Silvestre
Universidad Nacional
Apartado 1350-3000
Heredia
COSTA RICA
mspin...@una.cr 
mspinol...@gmail.com
Teléfono: (506) 8706 - 4662
Personal website: Lobito de río <https://sites.google.com/site/lobitoderio/>
Institutional website: ICOMVIS <http://www.icomvis.una.ac.cr/>

[[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] Species distribution modeling with presence-only data using log-Gaussian Cox process

2021-02-11 Thread Manuel Spínola
Thank you very much Edzer.

Manuel

El mar, 9 feb 2021 a las 14:18, Edzer Pebesma (<
edzer.pebe...@uni-muenster.de>) escribió:

> A  way out of this may be to make a local copy of the lgcp sources,
> remove the rpanel dependency from DESCRIPTION, and install it from
> there. You won't get the functions that need rpanel, but those might not
> be essential.
>
> On 09/02/2021 20:09, Manuel Spínola wrote:
> > Thank you very much Edzer.
> >
> > I tried to install lgcp, but I got an error message regarding BWidget.
> > I think that Bwidget is an external software and I don't know how to
> > install it in MacOS (Big Sur 11.2).
> >
> > Manuel
> >
> > This is the error that I get when trying to install lgcp in R 4.0.3:
> >
> > xcrun: error: invalid active developer path
> > (/Library/Developer/CommandLineTools), missing xcrun at:
> > /Library/Developer/CommandLineTools/usr/bin/xcrun
> > Warning message:
> > In system2("/usr/bin/otool", c("-L", shQuote(DSO)), stdout = TRUE) :
> >running command ''/usr/bin/otool' -L
> >
> '/Library/Frameworks/R.framework/Resources/library/tcltk/libs//tcltk.so''
> had
> > status 1
> > Error in structure(.External(.C_dotTcl, ...), class = "tclObj") :
> >[tcl] can't find package BWidget.
> >
> > Error: unable to load R code in package ‘rpanel’
> > Execution halted
> >
> > El mar, 9 feb 2021 a las 12:51, Edzer Pebesma
> > (mailto:edzer.pebe...@uni-muenster.de>>)
>
> > escribió:
> >
> > Have you tried package lgcp?
> >
> > On 09/02/2021 17:26, Manuel Spínola wrote:
> >  > Dear list members,
> >  >
> >  > I would like to know of any R package that can be used for
> > modeling species
> >  > distribution with presence-only data using log-Gaussian Cox
> process.
> >  >
> >  > Manuel
> >  >
> >
> > ___
> > R-sig-Geo mailing list
> > R-sig-Geo@r-project.org <mailto:R-sig-Geo@r-project.org>
> > https://stat.ethz.ch/mailman/listinfo/r-sig-geo
> >
> >
> >
> > --
> > *Manuel Spínola, Ph.D.*
> > Instituto Internacional en Conservación y Manejo de Vida Silvestre
> > Universidad Nacional
> > Apartado 1350-3000
> > Heredia
> > COSTA RICA
> > mspin...@una.cr <mailto:mspin...@una.ac.cr>
> > mspinol...@gmail.com <mailto:mspinol...@gmail.com>
> > Teléfono: (506) 8706 - 4662
> > Personal website: Lobito de río
> > <https://sites.google.com/site/lobitoderio/>
> > Institutional website: ICOMVIS <http://www.icomvis.una.ac.cr/>
>


-- 
*Manuel Spínola, Ph.D.*
Instituto Internacional en Conservación y Manejo de Vida Silvestre
Universidad Nacional
Apartado 1350-3000
Heredia
COSTA RICA
mspin...@una.cr 
mspinol...@gmail.com
Teléfono: (506) 8706 - 4662
Personal website: Lobito de río <https://sites.google.com/site/lobitoderio/>
Institutional website: ICOMVIS <http://www.icomvis.una.ac.cr/>

[[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] Species distribution modeling with presence-only data using log-Gaussian Cox process

2021-02-09 Thread Manuel Spínola
Thank you very much Edzer.

I tried to install lgcp, but I got an error message regarding BWidget.  I
think that Bwidget is an external software and I don't know how to install
it in MacOS (Big Sur 11.2).

Manuel

This is the error that I get when trying to install lgcp in R 4.0.3:

xcrun: error: invalid active developer path
(/Library/Developer/CommandLineTools), missing xcrun at:
/Library/Developer/CommandLineTools/usr/bin/xcrun
Warning message:
In system2("/usr/bin/otool", c("-L", shQuote(DSO)), stdout = TRUE) :
  running command ''/usr/bin/otool' -L
'/Library/Frameworks/R.framework/Resources/library/tcltk/libs//tcltk.so''
had status 1
Error in structure(.External(.C_dotTcl, ...), class = "tclObj") :
  [tcl] can't find package BWidget.

Error: unable to load R code in package ‘rpanel’
Execution halted

El mar, 9 feb 2021 a las 12:51, Edzer Pebesma (<
edzer.pebe...@uni-muenster.de>) escribió:

> Have you tried package lgcp?
>
> On 09/02/2021 17:26, Manuel Spínola wrote:
> > Dear list members,
> >
> > I would like to know of any R package that can be used for modeling
> species
> > distribution with presence-only data using log-Gaussian Cox process.
> >
> > Manuel
> >
>
> ___
> R-sig-Geo mailing list
> R-sig-Geo@r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>


-- 
*Manuel Spínola, Ph.D.*
Instituto Internacional en Conservación y Manejo de Vida Silvestre
Universidad Nacional
Apartado 1350-3000
Heredia
COSTA RICA
mspin...@una.cr 
mspinol...@gmail.com
Teléfono: (506) 8706 - 4662
Personal website: Lobito de río <https://sites.google.com/site/lobitoderio/>
Institutional website: ICOMVIS <http://www.icomvis.una.ac.cr/>

[[alternative HTML version deleted]]

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


[R-sig-Geo] Species distribution modeling with presence-only data using log-Gaussian Cox process

2021-02-09 Thread Manuel Spínola
Dear list members,

I would like to know of any R package that can be used for modeling species
distribution with presence-only data using log-Gaussian Cox process.

Manuel

-- 
*Manuel Spínola, Ph.D.*
Instituto Internacional en Conservación y Manejo de Vida Silvestre
Universidad Nacional
Apartado 1350-3000
Heredia
COSTA RICA
mspin...@una.cr 
mspinol...@gmail.com
Teléfono: (506) 8706 - 4662
Personal website: Lobito de río <https://sites.google.com/site/lobitoderio/>
Institutional website: ICOMVIS <http://www.icomvis.una.ac.cr/>

[[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] Accurate spatial database for country administrative boundaries

2020-12-02 Thread Manuel Spínola
Thank you very much Salvador and Melanie.

Manuel

El mié, 2 dic 2020 a las 12:08, Bacou, Melanie () escribió:

> See also FAO GAUL 2015 Edition (is the latest I blieve):
> https://geonode.wfp.org/layers/geonode%3Aadm1_gaul_2015
>
> And the UN Humanitarian Data Exchange for all latest official country
> boundaries:
> https://data.humdata.org/
>
> --Mel.
>
>
> On 12/1/20 5:34 PM, Manuel Spínola wrote:
>
> Thank you very much Diego.  Don´t worry.
>
> El mar, 1 dic 2020 a las 10:32, Diego Hernangómez Herrero 
> () escribió:
>
>
> My mistake, if you look for country-level boundaries giscoR may be an
> option. For administrative boundaries inside a country  (provinces, states,
> regions) giscoR only has information for European Union countries and a
> NUTS level, that does not match completely with the administrative levels
> of the country, so if this is your case it may not fit your needs.
>
> Hope that helped
>
>
> El El mar, 1 dic 2020 a las 17:22, Diego Hernangómez Herrero 
>  escribió:
>
>
> My two cent: 'giscoR’ package  can also be an option. The source of the
> file is Eurostat and you can get the data on 5 different resolution levels:
>
> https://ec.europa.eu/eurostat/web/gisco/geodata/reference-data/administrative-units-statistical-units/countries
>
>
> El El mar, 1 dic 2020 a las 17:19, Manuel Spínola  
> 
> escribió:
>
>
> Thank you very much Edzer.
>
> I will take a look at it.
>
> Manuel
>
> El mar, 1 dic 2020 a las 10:16, Edzer Pebesma 
> () escribió:
>
>
> Have you looked at package rnaturalearth? There's a web site for the
> dataset it interfaces: https://www.naturalearthdata.com/ - it looks
>
> like
>
> there's more information about its origins and processing that went on
> than behind GADM.
>
> On 12/1/20 4:26 PM, Manuel Spínola wrote:
>
> Dear list members,
>
> I am looking for a global accurate spatial database for countries'
> administrative boundaries.
>
> I tried the raster package, using the getData function and the GADM
> database and rgeoboundaries for the geoboundaries database, but I get
> differences between them.
>
> Is there any other spatial database for administrative boundaries
> accessible from R, so I can compare and decide which one is the most
> accurate of the open access spatial database for the countries I am
> interested?
>
> Thank you very much in advance.
>
> Manuel
>
>
>
>
> --
> Edzer Pebesma
> Institute for Geoinformatics
> Heisenbergstrasse 2, 48149 Muenster, Germany
> Phone: +49 251 8333081
>
>
> --
> *Manuel Spínola, Ph.D.*
> Instituto Internacional en Conservación y Manejo de Vida Silvestre
> Universidad Nacional
> Apartado 1350-3000
> Heredia
> COSTA ricamspin...@una.cr  
> mspinol...@gmail.com
> Teléfono: (506) 8706 - 4662
> Personal website: Lobito de río <
> https://sites.google.com/site/lobitoderio/> 
> <https://sites.google.com/site/lobitoderio/>
> Institutional website: ICOMVIS <http://www.icomvis.una.ac.cr/> 
> <http://www.icomvis.una.ac.cr/>
>
> [[alternative HTML version deleted]]
>
> ___
> R-sig-Geo mailing 
> listR-sig-Geo@r-project.orghttps://stat.ethz.ch/mailman/listinfo/r-sig-geo
>
> --
>
>
>
> Have a nice day!
>
>
> --
>
>
>
> Have a nice day!
>
>
>

-- 
*Manuel Spínola, Ph.D.*
Instituto Internacional en Conservación y Manejo de Vida Silvestre
Universidad Nacional
Apartado 1350-3000
Heredia
COSTA RICA
mspin...@una.cr 
mspinol...@gmail.com
Teléfono: (506) 8706 - 4662
Personal website: Lobito de río <https://sites.google.com/site/lobitoderio/>
Institutional website: ICOMVIS <http://www.icomvis.una.ac.cr/>

[[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] Accurate spatial database for country administrative boundaries

2020-12-01 Thread Manuel Spínola
Thank you very much Ahmadou.

El mar, 1 dic 2020 a las 11:33, Ahmadou Dicko ()
escribió:

> You can also try rgeoboundaries.
> It's a work in progress but I use it regularly and I'm just waiting for
> the new release of version 4 of the geoBoundaries database to push it to
> CRAN and fix some eventual errors.
>
> https://github.com/wmgeolab/rgeoboundaries
>
> Happy to help/support if you have any questions.
>
> Ahmadou
>
>
> On Tue, Dec 1, 2020 at 4:42 PM Diego Hernangómez Herrero <
> diego.hernangomezherr...@gmail.com> wrote:
>
>> My mistake, if you look for country-level boundaries giscoR may be an
>> option. For administrative boundaries inside a country  (provinces,
>> states,
>> regions) giscoR only has information for European Union countries and a
>> NUTS level, that does not match completely with the administrative levels
>> of the country, so if this is your case it may not fit your needs.
>>
>> Hope that helped
>>
>>
>> El El mar, 1 dic 2020 a las 17:22, Diego Hernangómez Herrero <
>> diego.hernangomezherr...@gmail.com> escribió:
>>
>> > My two cent: 'giscoR’ package  can also be an option. The source of the
>> > file is Eurostat and you can get the data on 5 different resolution
>> levels:
>> >
>> >
>> >
>> https://ec.europa.eu/eurostat/web/gisco/geodata/reference-data/administrative-units-statistical-units/countries
>> >
>> >
>> > El El mar, 1 dic 2020 a las 17:19, Manuel Spínola > >
>> > escribió:
>> >
>> >> Thank you very much Edzer.
>> >>
>> >> I will take a look at it.
>> >>
>> >> Manuel
>> >>
>> >> El mar, 1 dic 2020 a las 10:16, Edzer Pebesma (<
>> >> edzer.pebe...@uni-muenster.de>) escribió:
>> >>
>> >> > Have you looked at package rnaturalearth? There's a web site for the
>> >> > dataset it interfaces: https://www.naturalearthdata.com/ - it looks
>> >> like
>> >> > there's more information about its origins and processing that went
>> on
>> >> > than behind GADM.
>> >> >
>> >> > On 12/1/20 4:26 PM, Manuel Spínola wrote:
>> >> > > Dear list members,
>> >> > >
>> >> > > I am looking for a global accurate spatial database for countries'
>> >> > > administrative boundaries.
>> >> > >
>> >> > > I tried the raster package, using the getData function and the GADM
>> >> > > database and rgeoboundaries for the geoboundaries database, but I
>> get
>> >> > > differences between them.
>> >> > >
>> >> > > Is there any other spatial database for administrative boundaries
>> >> > > accessible from R, so I can compare and decide which one is the
>> most
>> >> > > accurate of the open access spatial database for the countries I am
>> >> > > interested?
>> >> > >
>> >> > > Thank you very much in advance.
>> >> > >
>> >> > > Manuel
>> >> > >
>> >> > >
>> >> > >
>> >> >
>> >> > --
>> >> > Edzer Pebesma
>> >> > Institute for Geoinformatics
>> >> > Heisenbergstrasse 2, 48149 Muenster, Germany
>> >> > Phone: +49 251 8333081
>> >> >
>> >>
>> >>
>> >> --
>> >> *Manuel Spínola, Ph.D.*
>> >> Instituto Internacional en Conservación y Manejo de Vida Silvestre
>> >> Universidad Nacional
>> >> Apartado 1350-3000
>> >> Heredia
>> >> COSTA RICA
>> >> mspin...@una.cr 
>> >> mspinol...@gmail.com
>> >> Teléfono: (506) 8706 - 4662
>> >> Personal website: Lobito de río <
>> >> https://sites.google.com/site/lobitoderio/>
>> >> Institutional website: ICOMVIS <http://www.icomvis.una.ac.cr/>
>> >>
>> >> [[alternative HTML version deleted]]
>> >>
>> >> ___
>> >> R-sig-Geo mailing list
>> >> R-sig-Geo@r-project.org
>> >> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>> >>
>> > --
>> >
>> >
>> >
>> > Have a nice day!
>> >
>> --
>>
>>
>>
>> Have a nice day!
>>
>> [[alternative HTML version deleted]]
>>
>> ___
>> R-sig-Geo mailing list
>> R-sig-Geo@r-project.org
>> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>>
>
>
> --
> Ahmadou H. DICKO, PhD
>
> Statistical consultant
> Mobile: (+221) 77 123 81 69
> Skype: dicko.ahmadou.h
> Twitter : @dickoah
> Gitlab: gitlab/dickoa
> Github: github/dickoa
>


-- 
*Manuel Spínola, Ph.D.*
Instituto Internacional en Conservación y Manejo de Vida Silvestre
Universidad Nacional
Apartado 1350-3000
Heredia
COSTA RICA
mspin...@una.cr 
mspinol...@gmail.com
Teléfono: (506) 8706 - 4662
Personal website: Lobito de río <https://sites.google.com/site/lobitoderio/>
Institutional website: ICOMVIS <http://www.icomvis.una.ac.cr/>

[[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] Accurate spatial database for country administrative boundaries

2020-12-01 Thread Manuel Spínola
Thank you very much Diego.  Don´t worry.

El mar, 1 dic 2020 a las 10:32, Diego Hernangómez Herrero (<
diego.hernangomezherr...@gmail.com>) escribió:

> My mistake, if you look for country-level boundaries giscoR may be an
> option. For administrative boundaries inside a country  (provinces, states,
> regions) giscoR only has information for European Union countries and a
> NUTS level, that does not match completely with the administrative levels
> of the country, so if this is your case it may not fit your needs.
>
> Hope that helped
>
>
> El El mar, 1 dic 2020 a las 17:22, Diego Hernangómez Herrero <
> diego.hernangomezherr...@gmail.com> escribió:
>
>> My two cent: 'giscoR’ package  can also be an option. The source of the
>> file is Eurostat and you can get the data on 5 different resolution levels:
>>
>>
>> https://ec.europa.eu/eurostat/web/gisco/geodata/reference-data/administrative-units-statistical-units/countries
>>
>>
>> El El mar, 1 dic 2020 a las 17:19, Manuel Spínola 
>> escribió:
>>
>>> Thank you very much Edzer.
>>>
>>> I will take a look at it.
>>>
>>> Manuel
>>>
>>> El mar, 1 dic 2020 a las 10:16, Edzer Pebesma (<
>>> edzer.pebe...@uni-muenster.de>) escribió:
>>>
>>> > Have you looked at package rnaturalearth? There's a web site for the
>>> > dataset it interfaces: https://www.naturalearthdata.com/ - it looks
>>> like
>>> > there's more information about its origins and processing that went on
>>> > than behind GADM.
>>> >
>>> > On 12/1/20 4:26 PM, Manuel Spínola wrote:
>>> > > Dear list members,
>>> > >
>>> > > I am looking for a global accurate spatial database for countries'
>>> > > administrative boundaries.
>>> > >
>>> > > I tried the raster package, using the getData function and the GADM
>>> > > database and rgeoboundaries for the geoboundaries database, but I get
>>> > > differences between them.
>>> > >
>>> > > Is there any other spatial database for administrative boundaries
>>> > > accessible from R, so I can compare and decide which one is the most
>>> > > accurate of the open access spatial database for the countries I am
>>> > > interested?
>>> > >
>>> > > Thank you very much in advance.
>>> > >
>>> > > Manuel
>>> > >
>>> > >
>>> > >
>>> >
>>> > --
>>> > Edzer Pebesma
>>> > Institute for Geoinformatics
>>> > Heisenbergstrasse 2, 48149 Muenster, Germany
>>> > Phone: +49 251 8333081
>>> >
>>>
>>>
>>> --
>>> *Manuel Spínola, Ph.D.*
>>> Instituto Internacional en Conservación y Manejo de Vida Silvestre
>>> Universidad Nacional
>>> Apartado 1350-3000
>>> Heredia
>>> COSTA RICA
>>> mspin...@una.cr 
>>> mspinol...@gmail.com
>>> Teléfono: (506) 8706 - 4662
>>> Personal website: Lobito de río <
>>> https://sites.google.com/site/lobitoderio/>
>>> Institutional website: ICOMVIS <http://www.icomvis.una.ac.cr/>
>>>
>>> [[alternative HTML version deleted]]
>>>
>>> ___
>>> R-sig-Geo mailing list
>>> R-sig-Geo@r-project.org
>>> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>>>
>> --
>>
>>
>>
>> Have a nice day!
>>
> --
>
>
>
> Have a nice day!
>


-- 
*Manuel Spínola, Ph.D.*
Instituto Internacional en Conservación y Manejo de Vida Silvestre
Universidad Nacional
Apartado 1350-3000
Heredia
COSTA RICA
mspin...@una.cr 
mspinol...@gmail.com
Teléfono: (506) 8706 - 4662
Personal website: Lobito de río <https://sites.google.com/site/lobitoderio/>
Institutional website: ICOMVIS <http://www.icomvis.una.ac.cr/>

[[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] Accurate spatial database for country administrative boundaries

2020-12-01 Thread Manuel Spínola
Thank you very much Edzer.

I will take a look at it.

Manuel

El mar, 1 dic 2020 a las 10:16, Edzer Pebesma (<
edzer.pebe...@uni-muenster.de>) escribió:

> Have you looked at package rnaturalearth? There's a web site for the
> dataset it interfaces: https://www.naturalearthdata.com/ - it looks like
> there's more information about its origins and processing that went on
> than behind GADM.
>
> On 12/1/20 4:26 PM, Manuel Spínola wrote:
> > Dear list members,
> >
> > I am looking for a global accurate spatial database for countries'
> > administrative boundaries.
> >
> > I tried the raster package, using the getData function and the GADM
> > database and rgeoboundaries for the geoboundaries database, but I get
> > differences between them.
> >
> > Is there any other spatial database for administrative boundaries
> > accessible from R, so I can compare and decide which one is the most
> > accurate of the open access spatial database for the countries I am
> > interested?
> >
> > Thank you very much in advance.
> >
> > Manuel
> >
> >
> >
>
> --
> Edzer Pebesma
> Institute for Geoinformatics
> Heisenbergstrasse 2, 48149 Muenster, Germany
> Phone: +49 251 8333081
>


-- 
*Manuel Spínola, Ph.D.*
Instituto Internacional en Conservación y Manejo de Vida Silvestre
Universidad Nacional
Apartado 1350-3000
Heredia
COSTA RICA
mspin...@una.cr 
mspinol...@gmail.com
Teléfono: (506) 8706 - 4662
Personal website: Lobito de río <https://sites.google.com/site/lobitoderio/>
Institutional website: ICOMVIS <http://www.icomvis.una.ac.cr/>

[[alternative HTML version deleted]]

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


[R-sig-Geo] Accurate spatial database for country administrative boundaries

2020-12-01 Thread Manuel Spínola
Dear list members,

I am looking for a global accurate spatial database for countries'
administrative boundaries.

I tried the raster package, using the getData function and the GADM
database and rgeoboundaries for the geoboundaries database, but I get
differences between them.

Is there any other spatial database for administrative boundaries
accessible from R, so I can compare and decide which one is the most
accurate of the open access spatial database for the countries I am
interested?

Thank you very much in advance.

Manuel



-- 
*Manuel Spínola, Ph.D.*
Instituto Internacional en Conservación y Manejo de Vida Silvestre
Universidad Nacional
Apartado 1350-3000
Heredia
COSTA RICA
mspin...@una.cr 
mspinol...@gmail.com
Teléfono: (506) 8706 - 4662
Personal website: Lobito de río <https://sites.google.com/site/lobitoderio/>
Institutional website: ICOMVIS <http://www.icomvis.una.ac.cr/>

[[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] rgdal release candidate 1.5-9 rev. 1000 ready for testing

2020-06-05 Thread Manuel Spínola
Thank you very much Ista.

Manuel

El vie., 5 jun. 2020 a las 18:44, Ista Zahn () escribió:

> On Fri, Jun 5, 2020 at 7:47 PM Manuel Spínola 
> wrote:
> >
> > Dear list members,
> >
> > Sorry for the confusion, but with all these suggestions, what is the way
> to
> > have the updated versions of the external
> > software GEOS, PROJ, and GDAL for macOS users.
>
> I think the current recommendation is "if you have to ask don't do
> it". Just wait for these to be updated in the OSX binary packages on
> CRAN.
>
> Best,
> Ista
>
> >
> > Manuel
> >
> > El vie., 5 jun. 2020 a las 14:31, Patrick Schratz (<
> > patrick.schr...@gmail.com>) escribió:
> >
> > > I am not sure if the part with
> > >
> > > use --with-proj_api="proj_api.h" for deprecated API
> > >
> > > Is of much help since c/p won’t work but the text let’s people
> > > assume that c/p could/should work.
> > > In fact, a full path to “proj_api.h” is required?
> > >
> > > I still do not like this blocker and I still do not know if this
> > > combination causes serious issues in production or just limits new
> > > features.
> > >
> > > For the time being, using and linking osgeo-gdal (3.0.1) and osgeo-proj
> > > (7.0.1) works and can be used as a workaround until homebrew-core
> > > formulas catch up.
> > >
> > > > checks OK on PROJ 7.0.1 and GDAL 2.2.4
> > >
> > > Again, since it was maybe caused by my typo a few mails ago: The
> > > homebred-core gdal version is at 2.4.4 and not 2.2.4.
> > >
> > > On 5 Jun 2020, at 13:29, Roger Bivand wrote:
> > >
> > > > The release candidate of rgdal_1.5-9 is ready for testing on R-forge:
> > > >
> > > > https://r-forge.r-project.org/R/?group_id=884
> > > >
> > > > Those insisting on installing on PROJ >= 6 and GDAL < 3 must use
> > > > configure argument --with-proj_api="proj_api.h"; with this used, this
> > > > version builds with --no-build-vignettes and installs and checks OK
> on
> > > > PROJ 7.0.1 and GDAL 2.2.4 with --with-proj_api="proj_api.h".
> > > >
> > > > Otherwise checked OK with PROJ 4.8.0, 4.9.2, 4.9.3 and 5.2.0 with
> GDAL
> > > > 1.11.4; with PROJ 5.2.0 and GDAL 2.2.4, 2.3.2 and 2.4.2; with PROJ
> > > > 6.3.2 and GDAL 3.0.4; with PROJ 7.0.1 and GDAL 3.0.4 and 3.1.0.
> > > >
> > > > All who have indicated issues with source installs are asked to try
> > > > the release candidate and to report back here by midnight CEST Monday
> > > > 8 June. If no indications are forthcoming, I'll assume that problems
> > > > with 1.5-8 are resolved.
> > > >
> > > > Roger
> > > >
> > > > --
> > > > Roger Bivand
> > > > Department of Economics, Norwegian School of Economics,
> > > > Helleveien 30, N-5045 Bergen, Norway.
> > > > voice: +47 55 95 93 55; e-mail: roger.biv...@nhh.no
> > > > https://orcid.org/-0003-2392-6140
> > > > https://scholar.google.no/citations?user=AWeghB0J=en
> > > >
> > > > ___
> > > > R-sig-Geo mailing list
> > > > R-sig-Geo@r-project.org
> > > > https://stat.ethz.ch/mailman/listinfo/r-sig-geo
> > >
> > > _______
> > > R-sig-Geo mailing list
> > > R-sig-Geo@r-project.org
> > > https://stat.ethz.ch/mailman/listinfo/r-sig-geo
> > >
> >
> >
> > --
> > *Manuel Spínola, Ph.D.*
> > Instituto Internacional en Conservación y Manejo de Vida Silvestre
> > Universidad Nacional
> > Apartado 1350-3000
> > Heredia
> > COSTA RICA
> > mspin...@una.cr 
> > mspinol...@gmail.com
> > Teléfono: (506) 8706 - 4662
> > Personal website: Lobito de río <
> https://sites.google.com/site/lobitoderio/>
> > Institutional website: ICOMVIS <http://www.icomvis.una.ac.cr/>
> >
> > [[alternative HTML version deleted]]
> >
> > ___
> > R-sig-Geo mailing list
> > R-sig-Geo@r-project.org
> > https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>


-- 
*Manuel Spínola, Ph.D.*
Instituto Internacional en Conservación y Manejo de Vida Silvestre
Universidad Nacional
Apartado 1350-3000
Heredia
COSTA RICA
mspin...@una.cr 
mspinol...@gmail.com
Teléfono: (506) 8706 - 4662
Personal website: Lobito de río <https://sites.google.com/site/lobitoderio/>
Institutional website: ICOMVIS <http://www.icomvis.una.ac.cr/>

[[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] rgdal release candidate 1.5-9 rev. 1000 ready for testing

2020-06-05 Thread Manuel Spínola
Dear list members,

Sorry for the confusion, but with all these suggestions, what is the way to
have the updated versions of the external
software GEOS, PROJ, and GDAL for macOS users.

Manuel

El vie., 5 jun. 2020 a las 14:31, Patrick Schratz (<
patrick.schr...@gmail.com>) escribió:

> I am not sure if the part with
>
> use --with-proj_api="proj_api.h" for deprecated API
>
> Is of much help since c/p won’t work but the text let’s people
> assume that c/p could/should work.
> In fact, a full path to “proj_api.h” is required?
>
> I still do not like this blocker and I still do not know if this
> combination causes serious issues in production or just limits new
> features.
>
> For the time being, using and linking osgeo-gdal (3.0.1) and osgeo-proj
> (7.0.1) works and can be used as a workaround until homebrew-core
> formulas catch up.
>
> > checks OK on PROJ 7.0.1 and GDAL 2.2.4
>
> Again, since it was maybe caused by my typo a few mails ago: The
> homebred-core gdal version is at 2.4.4 and not 2.2.4.
>
> On 5 Jun 2020, at 13:29, Roger Bivand wrote:
>
> > The release candidate of rgdal_1.5-9 is ready for testing on R-forge:
> >
> > https://r-forge.r-project.org/R/?group_id=884
> >
> > Those insisting on installing on PROJ >= 6 and GDAL < 3 must use
> > configure argument --with-proj_api="proj_api.h"; with this used, this
> > version builds with --no-build-vignettes and installs and checks OK on
> > PROJ 7.0.1 and GDAL 2.2.4 with --with-proj_api="proj_api.h".
> >
> > Otherwise checked OK with PROJ 4.8.0, 4.9.2, 4.9.3 and 5.2.0 with GDAL
> > 1.11.4; with PROJ 5.2.0 and GDAL 2.2.4, 2.3.2 and 2.4.2; with PROJ
> > 6.3.2 and GDAL 3.0.4; with PROJ 7.0.1 and GDAL 3.0.4 and 3.1.0.
> >
> > All who have indicated issues with source installs are asked to try
> > the release candidate and to report back here by midnight CEST Monday
> > 8 June. If no indications are forthcoming, I'll assume that problems
> > with 1.5-8 are resolved.
> >
> > Roger
> >
> > --
> > Roger Bivand
> > Department of Economics, Norwegian School of Economics,
> > Helleveien 30, N-5045 Bergen, Norway.
> > voice: +47 55 95 93 55; e-mail: roger.biv...@nhh.no
> > https://orcid.org/-0003-2392-6140
> > https://scholar.google.no/citations?user=AWeghB0J=en
> >
> > _______
> > R-sig-Geo mailing list
> > R-sig-Geo@r-project.org
> > https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>
> ___
> R-sig-Geo mailing list
> R-sig-Geo@r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>


-- 
*Manuel Spínola, Ph.D.*
Instituto Internacional en Conservación y Manejo de Vida Silvestre
Universidad Nacional
Apartado 1350-3000
Heredia
COSTA RICA
mspin...@una.cr 
mspinol...@gmail.com
Teléfono: (506) 8706 - 4662
Personal website: Lobito de río <https://sites.google.com/site/lobitoderio/>
Institutional website: ICOMVIS <http://www.icomvis.una.ac.cr/>

[[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] rgdal release candidate 1.5-9 rev. 1000 ready for testing

2020-06-05 Thread Manuel Spínola
Thank you very much Roger.  I will take that into consideration.

Manuel

El vie., 5 jun. 2020 a las 11:36, Roger Bivand ()
escribió:

> To all macOS users of r-spatial packages requiring external software for
> installation.
>
> Unless you are completely confident that you can install the external
> software, and install source packages without assistance, do not try to
> install packages like sf, rgdal, terra, gdalcubes and others from source.
> Do not choose "both", choose "binary". We cannot help you to install these
> packages from source. If that means waiting for new functionality, wait.
>
> If however you are confident that you can install from source yourself
> without asking us for help, for example because you are familiar with the
> software, or where you need to use the same versions of say PROJ, GEOS and
> GDAL that other geospatial programs do, please go ahead. We have an issue
> open on the r-spatial task view repo, which we can use to propagate proven
> ideas: https://github.com/r-spatial/task_views/issues/16. "It works for
> me now" is not proven - we need paths that have worked predictably for
> years without significant modification (unfortunately it seems that
> notarization has defeated Kyngchaos, which had worked well for years but
> no longer).
>
> Roger
>
> On Fri, 5 Jun 2020, Manuel Spínola wrote:
>
> > Thank you very much Thiago.
> >
> > I am very interested in that because I use R in macOS.
> >
> > Manuel
> >
> > El vie., 5 jun. 2020 a las 10:35, Thiago V. dos Santos via R-sig-Geo (<
> > r-sig-geo@r-project.org>) escribió:
> >
> >> Hi Roy,
> >>
> >> I use and recommend MacPorts as a package manager for macOS computers.
> It
> >> is quite comprehensive in terms of programs/libraries available, almost
> >> always up-to-date and pretty simple to use. It does not always provide
> >> binaries though, it needs to compile a few packages from source (gdal
> is an
> >> example) - which can take a little bit, depending on your machine
> >> configuration.
> >>
> >> I have some notes on how to set it up - maybe it's useful for you:
> >> https://thiagodossantos.com/post/1-mac-science-software/
> >>
> >> Greetings,
> >>  -- Thiago V. dos Santos
> >>
> >> ThiagoDosSantos.com
> >> MudancasClimaticasBrasil.com
> >>
> >>
> >>
> >>
> >>
> >>
> >> On Friday, June 5, 2020, 10:54:55 AM GMT-3, Roy Mendelssohn - NOAA
> Federal
> >> via R-sig-Geo  wrote:
> >>
> >>
> >>
> >>
> >>
> >> Hi All:
> >>
> >> Is there a source for binaries of PROJ >= 6 and GDAL > 3  for the Mac,
> >> other than the Anaconda ones which cause problems because they use
> @rpart?
> >>
> >> Thanks,
> >>
> >> -Roy
> >>
> >>
> >>> On Jun 5, 2020, at 4:29 AM, Roger Bivand  wrote:
> >>>
> >>> The release candidate of rgdal_1.5-9 is ready for testing on R-forge:
> >>>
> >>> https://r-forge.r-project.org/R/?group_id=884
> >>>
> >>> Those insisting on installing on PROJ >= 6 and GDAL < 3 must use
> >> configure argument --with-proj_api="proj_api.h"; with this used, this
> >> version builds with --no-build-vignettes and installs and checks OK on
> PROJ
> >> 7.0.1 and GDAL 2.2.4 with --with-proj_api="proj_api.h".
> >>>
> >>> Otherwise checked OK with PROJ 4.8.0, 4.9.2, 4.9.3 and 5.2.0 with GDAL
> >> 1.11.4; with PROJ 5.2.0 and GDAL 2.2.4, 2.3.2 and 2.4.2; with PROJ 6.3.2
> >> and GDAL 3.0.4; with PROJ 7.0.1 and GDAL 3.0.4 and 3.1.0.
> >>>
> >>> All who have indicated issues with source installs are asked to try the
> >> release candidate and to report back here by midnight CEST Monday 8
> June.
> >> If no indications are forthcoming, I'll assume that problems with 1.5-8
> are
> >> resolved.
> >>>
> >>> Roger
> >>>
> >>> --
> >>> Roger Bivand
> >>> Department of Economics, Norwegian School of Economics,
> >>> Helleveien 30, N-5045 Bergen, Norway.
> >>> voice: +47 55 95 93 55; e-mail: roger.biv...@nhh.no
> >>> https://orcid.org/-0003-2392-6140
> >>> https://scholar.google.no/citations?user=AWeghB0J=en
> >>>
> >>> ___
> >>> R-sig-Geo mailing list
> >>> R-sig-Geo

Re: [R-sig-Geo] rgdal release candidate 1.5-9 rev. 1000 ready for testing

2020-06-05 Thread Manuel Spínola
Thank you very much Thiago.

I am very interested in that because I use R in macOS.

Manuel

El vie., 5 jun. 2020 a las 10:35, Thiago V. dos Santos via R-sig-Geo (<
r-sig-geo@r-project.org>) escribió:

> Hi Roy,
>
> I use and recommend MacPorts as a package manager for macOS computers. It
> is quite comprehensive in terms of programs/libraries available, almost
> always up-to-date and pretty simple to use. It does not always provide
> binaries though, it needs to compile a few packages from source (gdal is an
> example) - which can take a little bit, depending on your machine
> configuration.
>
> I have some notes on how to set it up - maybe it's useful for you:
> https://thiagodossantos.com/post/1-mac-science-software/
>
> Greetings,
>  -- Thiago V. dos Santos
>
> ThiagoDosSantos.com
> MudancasClimaticasBrasil.com
>
>
>
>
>
>
> On Friday, June 5, 2020, 10:54:55 AM GMT-3, Roy Mendelssohn - NOAA Federal
> via R-sig-Geo  wrote:
>
>
>
>
>
> Hi All:
>
> Is there a source for binaries of PROJ >= 6 and GDAL > 3  for the Mac,
> other than the Anaconda ones which cause problems because they use @rpart?
>
> Thanks,
>
> -Roy
>
>
> > On Jun 5, 2020, at 4:29 AM, Roger Bivand  wrote:
> >
> > The release candidate of rgdal_1.5-9 is ready for testing on R-forge:
> >
> > https://r-forge.r-project.org/R/?group_id=884
> >
> > Those insisting on installing on PROJ >= 6 and GDAL < 3 must use
> configure argument --with-proj_api="proj_api.h"; with this used, this
> version builds with --no-build-vignettes and installs and checks OK on PROJ
> 7.0.1 and GDAL 2.2.4 with --with-proj_api="proj_api.h".
> >
> > Otherwise checked OK with PROJ 4.8.0, 4.9.2, 4.9.3 and 5.2.0 with GDAL
> 1.11.4; with PROJ 5.2.0 and GDAL 2.2.4, 2.3.2 and 2.4.2; with PROJ 6.3.2
> and GDAL 3.0.4; with PROJ 7.0.1 and GDAL 3.0.4 and 3.1.0.
> >
> > All who have indicated issues with source installs are asked to try the
> release candidate and to report back here by midnight CEST Monday 8 June.
> If no indications are forthcoming, I'll assume that problems with 1.5-8 are
> resolved.
> >
> > Roger
> >
> > --
> > Roger Bivand
> > Department of Economics, Norwegian School of Economics,
> > Helleveien 30, N-5045 Bergen, Norway.
> > voice: +47 55 95 93 55; e-mail: roger.biv...@nhh.no
> > https://orcid.org/-0003-2392-6140
> > https://scholar.google.no/citations?user=AWeghB0J=en
> >
> > ___
> > R-sig-Geo mailing list
> > R-sig-Geo@r-project.org
> > https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>
> **
> "The contents of this message do not reflect any position of the U.S.
> Government or NOAA."
> **
> Roy Mendelssohn
> Supervisory Operations Research Analyst
> NOAA/NMFS
> Environmental Research Division
> Southwest Fisheries Science Center
> ***Note new street address***
> 110 McAllister Way
> Santa Cruz, CA 95060
> Phone: (831)-420-3666
> Fax: (831) 420-3980
> e-mail: roy.mendelss...@noaa.gov www: https://www.pfeg.noaa.gov/
>
> "Old age and treachery will overcome youth and skill."
> "From those who have been given much, much will be expected"
> "the arc of the moral universe is long, but it bends toward justice" -MLK
> Jr.
>
>
> ___
> R-sig-Geo mailing list
> R-sig-Geo@r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>
> ___
> R-sig-Geo mailing list
> R-sig-Geo@r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>


-- 
*Manuel Spínola, Ph.D.*
Instituto Internacional en Conservación y Manejo de Vida Silvestre
Universidad Nacional
Apartado 1350-3000
Heredia
COSTA RICA
mspin...@una.cr 
mspinol...@gmail.com
Teléfono: (506) 8706 - 4662
Personal website: Lobito de río <https://sites.google.com/site/lobitoderio/>
Institutional website: ICOMVIS <http://www.icomvis.una.ac.cr/>

[[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 can I update to versions GEOS 3.8.0, GDAL 3.0.4 and PROJ 7.0.0

2020-05-24 Thread Manuel Spínola
Thank you very much Alberto.

Manuel

El dom., 24 may. 2020 a las 4:48, Alberto Lázaro-López (<
alazaro...@posteo.me>) escribió:

> Hi Manuel,
>
> Homebrew for Mac can be extended with taps or external repositories. You
> could give a try to OSGeo4Mac tap [1].
> At this moment, it’s serving bottles for GDAL 3.1.0 and PROJ 6.3.2, but
> also other GIS software as PostGIS or SAGA.
> For example, this is what you get with sf:
>
> > library(sf)
> Linking to GEOS 3.8.1, GDAL 3.1.0, PROJ 6.3.2
>
> [1] https://github.com/OSGeo/homebrew-osgeo4mac
>
> You can solve any doubt through the Github issue page too. I hope you find
> it useful.
>
> Best regards,
>
> Alberto Lázaro López
> about.me/alazarolop
>
> ___
> R-sig-Geo mailing list
> R-sig-Geo@r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>


-- 
*Manuel Spínola, Ph.D.*
Instituto Internacional en Conservación y Manejo de Vida Silvestre
Universidad Nacional
Apartado 1350-3000
Heredia
COSTA RICA
mspin...@una.cr 
mspinol...@gmail.com
Teléfono: (506) 8706 - 4662
Personal website: Lobito de río <https://sites.google.com/site/lobitoderio/>
Institutional website: ICOMVIS <http://www.icomvis.una.ac.cr/>

[[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 can I update to versions GEOS 3.8.0, GDAL 3.0.4 and PROJ 7.0.0

2020-05-21 Thread Manuel Spínola
Thank you very much Ista.

El jue., 21 may. 2020 a las 15:41, Ista Zahn ()
escribió:

> Hi Manuel,
>
> It looks like the brew gdal formula hasn't been updated to version 3
> yet[1] at least in part because it breaks other things[2]. Personally
> I would just wait for the homebrew community to sort this out.
>
> Best,
> Ista
>
> [1] https://formulae.brew.sh/formula/gdal
> [2] https://github.com/Homebrew/homebrew-core/pull/46817
>
> On Thu, May 21, 2020 at 4:50 PM Manuel Spínola 
> wrote:
> >
> > Thank you very much Ista.
> >
> > I tried several times but I don´t get the last version of gdal
> >
> > (base) Manuels-MacBook-Pro:~ manuelspinola$ brew install gdal
> >
> > Warning: gdal 2.4.4_6 is already installed and up-to-date
> >
> > To reinstall 2.4.4_6, run `brew reinstall gdal`
> >
> > (base) Manuels-MacBook-Pro:~ manuelspinola$
> >
> >
> >
> >
> > El jue., 21 may. 2020 a las 13:51, Ista Zahn ()
> escribió:
> >>
> >> I don't have a Mac myself, but both https://r-spatial.github.io/sf/
> >> and https://github.com/rspatial/terra recommend installing gdal etc.
> >> via homebrew.
> >>
> >> Best,
> >> Ista
> >>
> >> On Thu, May 21, 2020 at 2:41 PM Manuel Spínola 
> wrote:
> >> >
> >> > Thank you very much Rich.
> >> >
> >> > Manuel
> >> >
> >> > El jue., 21 may. 2020 a las 7:22, Rich Shepard (<
> rshep...@appl-ecosys.com>)
> >> > escribió:
> >> >
> >> > > On Thu, 21 May 2020, Manuel Spínola wrote:
> >> > >
> >> > > > I am working with R 4.0.0 on MacOS Catalina 10.15.4.
> >> > > > When I load, for example, the library sf, I realized that I have
> older
> >> > > > versions of GEOS, GDAL  and PROJ
> >> > >
> >> > > > How can I update to the latest versions GEOS 3.8.0, GDAL 3.0.4
> and PROJ
> >> > > > 7.0.0
> >> > >
> >> > > Manuel,
> >> > >
> >> > > I've no idea how macOS works yet I offer the advice that you
> >> > > build/upgrade/install this stack by first doing PROJ, then GEOS, and
> >> > > finally
> >> > > GDAL. The sequence matters as each builds on the earlier one(s).
> >> > >
> >> > > Regards,
> >> > >
> >> > > Rich
> >> > >
> >> > > ___
> >> > > R-sig-Geo mailing list
> >> > > R-sig-Geo@r-project.org
> >> > > https://stat.ethz.ch/mailman/listinfo/r-sig-geo
> >> > >
> >> >
> >> >
> >> > --
> >> > *Manuel Spínola, Ph.D.*
> >> > Instituto Internacional en Conservación y Manejo de Vida Silvestre
> >> > Universidad Nacional
> >> > Apartado 1350-3000
> >> > Heredia
> >> > COSTA RICA
> >> > mspin...@una.cr 
> >> > mspinol...@gmail.com
> >> > Teléfono: (506) 8706 - 4662
> >> > Personal website: Lobito de río <
> https://sites.google.com/site/lobitoderio/>
> >> > Institutional website: ICOMVIS <http://www.icomvis.una.ac.cr/>
> >> >
> >> > [[alternative HTML version deleted]]
> >> >
> >> > ___
> >> > R-sig-Geo mailing list
> >> > R-sig-Geo@r-project.org
> >> > https://stat.ethz.ch/mailman/listinfo/r-sig-geo
> >
> >
> >
> > --
> > Manuel Spínola, Ph.D.
> > Instituto Internacional en Conservación y Manejo de Vida Silvestre
> > Universidad Nacional
> > Apartado 1350-3000
> > Heredia
> > COSTA RICA
> > mspin...@una.cr
> > mspinol...@gmail.com
> > Teléfono: (506) 8706 - 4662
> > Personal website: Lobito de río
> > Institutional website: ICOMVIS
>


-- 
*Manuel Spínola, Ph.D.*
Instituto Internacional en Conservación y Manejo de Vida Silvestre
Universidad Nacional
Apartado 1350-3000
Heredia
COSTA RICA
mspin...@una.cr 
mspinol...@gmail.com
Teléfono: (506) 8706 - 4662
Personal website: Lobito de río <https://sites.google.com/site/lobitoderio/>
Institutional website: ICOMVIS <http://www.icomvis.una.ac.cr/>

[[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 can I update to versions GEOS 3.8.0, GDAL 3.0.4 and PROJ 7.0.0

2020-05-21 Thread Manuel Spínola
Thank you very much Ista.

I tried several times but I don´t get the last version of gdal

(base) Manuels-MacBook-Pro:~ manuelspinola$ brew install gdal

Warning: gdal 2.4.4_6 is already installed and up-to-date

To reinstall 2.4.4_6, run `brew reinstall gdal`

(base) Manuels-MacBook-Pro:~ manuelspinola$




El jue., 21 may. 2020 a las 13:51, Ista Zahn ()
escribió:

> I don't have a Mac myself, but both https://r-spatial.github.io/sf/
> and https://github.com/rspatial/terra recommend installing gdal etc.
> via homebrew.
>
> Best,
> Ista
>
> On Thu, May 21, 2020 at 2:41 PM Manuel Spínola 
> wrote:
> >
> > Thank you very much Rich.
> >
> > Manuel
> >
> > El jue., 21 may. 2020 a las 7:22, Rich Shepard (<
> rshep...@appl-ecosys.com>)
> > escribió:
> >
> > > On Thu, 21 May 2020, Manuel Spínola wrote:
> > >
> > > > I am working with R 4.0.0 on MacOS Catalina 10.15.4.
> > > > When I load, for example, the library sf, I realized that I have
> older
> > > > versions of GEOS, GDAL  and PROJ
> > >
> > > > How can I update to the latest versions GEOS 3.8.0, GDAL 3.0.4 and
> PROJ
> > > > 7.0.0
> > >
> > > Manuel,
> > >
> > > I've no idea how macOS works yet I offer the advice that you
> > > build/upgrade/install this stack by first doing PROJ, then GEOS, and
> > > finally
> > > GDAL. The sequence matters as each builds on the earlier one(s).
> > >
> > > Regards,
> > >
> > > Rich
> > >
> > > ___
> > > R-sig-Geo mailing list
> > > R-sig-Geo@r-project.org
> > > https://stat.ethz.ch/mailman/listinfo/r-sig-geo
> > >
> >
> >
> > --
> > *Manuel Spínola, Ph.D.*
> > Instituto Internacional en Conservación y Manejo de Vida Silvestre
> > Universidad Nacional
> > Apartado 1350-3000
> > Heredia
> > COSTA RICA
> > mspin...@una.cr 
> > mspinol...@gmail.com
> > Teléfono: (506) 8706 - 4662
> > Personal website: Lobito de río <
> https://sites.google.com/site/lobitoderio/>
> > Institutional website: ICOMVIS <http://www.icomvis.una.ac.cr/>
> >
> > [[alternative HTML version deleted]]
> >
> > ___
> > R-sig-Geo mailing list
> > R-sig-Geo@r-project.org
> > https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>


-- 
*Manuel Spínola, Ph.D.*
Instituto Internacional en Conservación y Manejo de Vida Silvestre
Universidad Nacional
Apartado 1350-3000
Heredia
COSTA RICA
mspin...@una.cr 
mspinol...@gmail.com
Teléfono: (506) 8706 - 4662
Personal website: Lobito de río <https://sites.google.com/site/lobitoderio/>
Institutional website: ICOMVIS <http://www.icomvis.una.ac.cr/>

[[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 can I update to versions GEOS 3.8.0, GDAL 3.0.4 and PROJ 7.0.0

2020-05-21 Thread Manuel Spínola
Thank you very much Rich.

Manuel

El jue., 21 may. 2020 a las 7:22, Rich Shepard ()
escribió:

> On Thu, 21 May 2020, Manuel Spínola wrote:
>
> > I am working with R 4.0.0 on MacOS Catalina 10.15.4.
> > When I load, for example, the library sf, I realized that I have older
> > versions of GEOS, GDAL  and PROJ
>
> > How can I update to the latest versions GEOS 3.8.0, GDAL 3.0.4 and PROJ
> > 7.0.0
>
> Manuel,
>
> I've no idea how macOS works yet I offer the advice that you
> build/upgrade/install this stack by first doing PROJ, then GEOS, and
> finally
> GDAL. The sequence matters as each builds on the earlier one(s).
>
> Regards,
>
> Rich
>
> ___
> R-sig-Geo mailing list
> R-sig-Geo@r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>


-- 
*Manuel Spínola, Ph.D.*
Instituto Internacional en Conservación y Manejo de Vida Silvestre
Universidad Nacional
Apartado 1350-3000
Heredia
COSTA RICA
mspin...@una.cr 
mspinol...@gmail.com
Teléfono: (506) 8706 - 4662
Personal website: Lobito de río <https://sites.google.com/site/lobitoderio/>
Institutional website: ICOMVIS <http://www.icomvis.una.ac.cr/>

[[alternative HTML version deleted]]

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


[R-sig-Geo] How can I update to versions GEOS 3.8.0, GDAL 3.0.4 and PROJ 7.0.0

2020-05-21 Thread Manuel Spínola
Dear list members,

I am working with R 4.0.0 on MacOS Catalina 10.15.4.

When I load, for example, the library sf, I realized that I have older
versions of GEOS, GDAL  and PROJ

> library(sf)
Linking to GEOS 3.7.2, GDAL 2.4.2, PROJ 5.2.0

How can I update to the latest versions GEOS 3.8.0, GDAL 3.0.4 and PROJ
7.0.0

Manuel

-- 
*Manuel Spínola, Ph.D.*
Instituto Internacional en Conservación y Manejo de Vida Silvestre
Universidad Nacional
Apartado 1350-3000
Heredia
COSTA RICA
mspin...@una.cr 
mspinol...@gmail.com
Teléfono: (506) 8706 - 4662
Personal website: Lobito de río <https://sites.google.com/site/lobitoderio/>
Institutional website: ICOMVIS <http://www.icomvis.una.ac.cr/>

[[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] unable to remove spatial autocorrelation from a binomial gam

2020-04-12 Thread Manuel Spínola
ults from a variogram show spatial
> >> autocorrelation in the residuals of my gam (range=6000 meters). Since I
> am
> >> modelling a binary response, using a gamm with a correlation structure
> is
> >> not advisable because it "performs poorly with binary data", neither
> gamm4
> >> because (although is supposed to be appropriate for binary data) it has
> >> "no
> >> facility for nlme style correlation structures".
> >>
> >> The alternative I have found is to fit my model using the function magic
> >> from the same mgcv package. Because I found no examples of how to use
> >> magic
> >> for spatially correlated data I have adapted the ?magic example for
> >> temporally correlated data. The results of the output change the
> >> coefficients of the model but do not remove the spatial autocorrelation
> >> and
> >> the smooth plots show the same effect.
> >> You can find find the output from my models and figures of the
> variograms
> >> and plots of the smooth effects in the following link
> >>
> >>
> https://stackoverflow.com/questions/61110762/gam-with-binomial-distribution-and-with-spatial-autocorrelation-in-r
> >>
> >>
> >> Could someone tell me if there is something wrong in my script? Does
> >> anyone
> >> know another alternative to remove the residuals' spatial
> autocorrelation
> >> from a binomial gam?
> >>
> >> Thank you very much.
> >> Kind regards,
> >> Carlos
> >> --
> >> Carlos Bautista
> >> Institute of Nature Conservation
> >> Polish Academy of Sciences
> >> Mickiewicza 33
> >> 31-120 Krakow, Poland
> >> www.carpathianbear.pl
> >> www.iop.krakow.pl
> >>
> >> [[alternative HTML version deleted]]
> >>
> >> ___
> >> R-sig-Geo mailing list
> >> R-sig-Geo@r-project.org
> >> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
> >>
> >
>
> --
> Carlos Bautista
> Institute of Nature Conservation
> Polish Academy of Sciences
> Mickiewicza 33
> 31-120 Krakow, Poland
> www.carpathianbear.pl
> www.iop.krakow.pl
>
> [[alternative HTML version deleted]]
>
> ___
> R-sig-Geo mailing list
> R-sig-Geo@r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>


-- 
*Manuel Spínola, Ph.D.*
Instituto Internacional en Conservación y Manejo de Vida Silvestre
Universidad Nacional
Apartado 1350-3000
Heredia
COSTA RICA
mspin...@una.cr 
mspinol...@gmail.com
Teléfono: (506) 8706 - 4662
Personal website: Lobito de río <https://sites.google.com/site/lobitoderio/>
Institutional website: ICOMVIS <http://www.icomvis.una.ac.cr/>

[[alternative HTML version deleted]]

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


[R-sig-Geo] Problem with function predict in package GSIF

2019-09-30 Thread Manuel Spínola
Dear list members,

I am using the predict function of the GSIF package but after running for a
while I do not get an output and when I stop the process I got the
following message (see below).

I fit the fit.gstatModel

co_rk_rf <- fit.gstatModel(datos_co_sp["co"], co_formulaString_correlacion,
covar_finales_sp, method = "quantregForest")

Fitting a Quantile Regression Forest model...
Shapiro-Wilk normality test and Anderson-Darling normality test report
probability of < .05 indicating lack of normal distribution for
residualsFitting a 2D variogram...
No convergence after 200 iterations: try different initial values?singular
model in variogram fitSaving an object of class 'gstatModel'...
but when I try the prediction it gave me an error message


co_rk_rf_pred <- predict(co_rk_rf, covar_finales_sp)

no loop for break/next, jumping to top level

I tried with same data set before and it works, but not now.  I also tried
with similar data sets and it works.

Any idea what could be causing the problem?


Manuel

-- 
*Manuel Spínola, Ph.D.*
Instituto Internacional en Conservación y Manejo de Vida Silvestre
Universidad Nacional
Apartado 1350-3000
Heredia
COSTA RICA
mspin...@una.cr 
mspinol...@gmail.com
Teléfono: (506) 8706 - 4662
Personal website: Lobito de río <https://sites.google.com/site/lobitoderio/>
Institutional website: ICOMVIS <http://www.icomvis.una.ac.cr/>

[[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] landmap package, predict method gave an error of memory exhausted

2019-09-16 Thread Manuel Spínola
Thank you Tom.  Is a regression type problem.

I will send you a copy of my data.

Manuel

El lun., 16 sept. 2019 a las 8:54, Tomislav Hengl ()
escribió:

>
> Manuel,
>
> Please send me a private message and a copy of your data so I can test
> where does the RAM blows up. Is it a classification or regression type
> problem?
>
> T. Hengl
>
> On 9/16/19 4:01 PM, Manuel Spínola wrote:
> > Dear list members,
> >
> > I am fitting an Ensemble Machine Learning with the R package landmap,
> using
> > the function train.spLearner, the resulting object is large 2.5 GB, and
> > when I tried to predict I I got the message of memory exhausted.
> >
> > I have only 14 points and 23 covariables, in a very small area.
> >
> > Using R 3.6.1
> > MacOS, 16GB of ram
> >
> >
> > pred_co <- predict(m_co)
> >
> > Error: vector memory exhausted (limit reached?)
> > Error during wrapup: vector memory exhausted (limit reached?)
> >
> >
> >
>


-- 
*Manuel Spínola, Ph.D.*
Instituto Internacional en Conservación y Manejo de Vida Silvestre
Universidad Nacional
Apartado 1350-3000
Heredia
COSTA RICA
mspin...@una.cr 
mspinol...@gmail.com
Teléfono: (506) 8706 - 4662
Personal website: Lobito de río <https://sites.google.com/site/lobitoderio/>
Institutional website: ICOMVIS <http://www.icomvis.una.ac.cr/>

[[alternative HTML version deleted]]

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


[R-sig-Geo] landmap package, predict method gave an error of memory exhausted

2019-09-16 Thread Manuel Spínola
Dear list members,

I am fitting an Ensemble Machine Learning with the R package landmap, using
the function train.spLearner, the resulting object is large 2.5 GB, and
when I tried to predict I I got the message of memory exhausted.

I have only 14 points and 23 covariables, in a very small area.

Using R 3.6.1
MacOS, 16GB of ram


pred_co <- predict(m_co)

Error: vector memory exhausted (limit reached?)
Error during wrapup: vector memory exhausted (limit reached?)



-- 
*Manuel Spínola, Ph.D.*
Instituto Internacional en Conservación y Manejo de Vida Silvestre
Universidad Nacional
Apartado 1350-3000
Heredia
COSTA RICA
mspin...@una.cr 
mspinol...@gmail.com
Teléfono: (506) 8706 - 4662
Personal website: Lobito de río <https://sites.google.com/site/lobitoderio/>
Institutional website: ICOMVIS <http://www.icomvis.una.ac.cr/>

[[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] Problem of vector allocation in GSIF package

2019-09-13 Thread Manuel Spínola
I wanted to say, "I would like to try landmap".

El vie., 13 sept. 2019 a las 9:45, Tomislav Hengl ()
escribió:

>
> You have two options:
>
> 1. Run predictions using tiling
> (
> https://github.com/Envirometrix/BigSpatialDataR#dem-analysis-using-tiling-and-parallelization
> )
>
> 2. Buy more RAM.
>
> I suggest using option 1 since option 2 can propagate to infinity.
>
> PS: I am working on a new package
> (https://github.com/Envirometrix/landmap/) that should give more
> flexibility to users and maybe even incorporate tiling of large objects
> by default.
>
>
> On 9/13/19 5:38 PM, Manuel Spínola wrote:
> > Dear list members,
> >
> > I am fitting a model with the GSIF package, but I ran into a problem of
> > vector allocation.  Is there any way to solve this problem?  See code and
> > error message below.
> >
> > I am using:
> > R 3.6.1
> > GSIF 0.5-5
> > Mac with 16 GB of RAM
> >
> >> rk_rf_ac <- fit.gstatModel(variables_todos_sp["ac"],
> ac_formulaString_correlacion, covar_finales_sp, method =
> "quantregForest")Fitting a Quantile Regression Forest model...Shapiro-Wilk
> normality test and Anderson-Darling normality test report probability of <
> .05 indicating lack of normal distribution for residualsFitting a 2D
> variogram...Saving an object of class 'gstatModel'...> rk_rf_ac_pred <-
> GSIF::predict(rk_rf_ac, covar_finales_sp, predict.method = "KED")Error:
> cannot allocate vector of size 19.4 Gb
> >
> > Thank you very much,
> >
> > Manuel
> >
>


-- 
*Manuel Spínola, Ph.D.*
Instituto Internacional en Conservación y Manejo de Vida Silvestre
Universidad Nacional
Apartado 1350-3000
Heredia
COSTA RICA
mspin...@una.cr 
mspinol...@gmail.com
Teléfono: (506) 8706 - 4662
Personal website: Lobito de río <https://sites.google.com/site/lobitoderio/>
Institutional website: ICOMVIS <http://www.icomvis.una.ac.cr/>

[[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] Problem of vector allocation in GSIF package

2019-09-13 Thread Manuel Spínola
Thank you very much Tom.

I will like to try landmap.

Best,

Manuel

El vie., 13 sept. 2019 a las 9:45, Tomislav Hengl ()
escribió:

>
> You have two options:
>
> 1. Run predictions using tiling
> (
> https://github.com/Envirometrix/BigSpatialDataR#dem-analysis-using-tiling-and-parallelization
> )
>
> 2. Buy more RAM.
>
> I suggest using option 1 since option 2 can propagate to infinity.
>
> PS: I am working on a new package
> (https://github.com/Envirometrix/landmap/) that should give more
> flexibility to users and maybe even incorporate tiling of large objects
> by default.
>
>
> On 9/13/19 5:38 PM, Manuel Spínola wrote:
> > Dear list members,
> >
> > I am fitting a model with the GSIF package, but I ran into a problem of
> > vector allocation.  Is there any way to solve this problem?  See code and
> > error message below.
> >
> > I am using:
> > R 3.6.1
> > GSIF 0.5-5
> > Mac with 16 GB of RAM
> >
> >> rk_rf_ac <- fit.gstatModel(variables_todos_sp["ac"],
> ac_formulaString_correlacion, covar_finales_sp, method =
> "quantregForest")Fitting a Quantile Regression Forest model...Shapiro-Wilk
> normality test and Anderson-Darling normality test report probability of <
> .05 indicating lack of normal distribution for residualsFitting a 2D
> variogram...Saving an object of class 'gstatModel'...> rk_rf_ac_pred <-
> GSIF::predict(rk_rf_ac, covar_finales_sp, predict.method = "KED")Error:
> cannot allocate vector of size 19.4 Gb
> >
> > Thank you very much,
> >
> > Manuel
> >
>


-- 
*Manuel Spínola, Ph.D.*
Instituto Internacional en Conservación y Manejo de Vida Silvestre
Universidad Nacional
Apartado 1350-3000
Heredia
COSTA RICA
mspin...@una.cr 
mspinol...@gmail.com
Teléfono: (506) 8706 - 4662
Personal website: Lobito de río <https://sites.google.com/site/lobitoderio/>
Institutional website: ICOMVIS <http://www.icomvis.una.ac.cr/>

[[alternative HTML version deleted]]

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


[R-sig-Geo] Problem of vector allocation in GSIF package

2019-09-13 Thread Manuel Spínola
Dear list members,

I am fitting a model with the GSIF package, but I ran into a problem of
vector allocation.  Is there any way to solve this problem?  See code and
error message below.

I am using:
R 3.6.1
GSIF 0.5-5
Mac with 16 GB of RAM

> rk_rf_ac <- fit.gstatModel(variables_todos_sp["ac"], 
> ac_formulaString_correlacion, covar_finales_sp, method = 
> "quantregForest")Fitting a Quantile Regression Forest model...Shapiro-Wilk 
> normality test and Anderson-Darling normality test report probability of < 
> .05 indicating lack of normal distribution for residualsFitting a 2D 
> variogram...Saving an object of class 'gstatModel'...> rk_rf_ac_pred <- 
> GSIF::predict(rk_rf_ac, covar_finales_sp, predict.method = "KED")Error: 
> cannot allocate vector of size 19.4 Gb

Thank you very much,

Manuel

-- 
*Manuel Spínola, Ph.D.*
Instituto Internacional en Conservación y Manejo de Vida Silvestre
Universidad Nacional
Apartado 1350-3000
Heredia
COSTA RICA
mspin...@una.cr 
mspinol...@gmail.com
Teléfono: (506) 8706 - 4662
Personal website: Lobito de río <https://sites.google.com/site/lobitoderio/>
Institutional website: ICOMVIS <http://www.icomvis.una.ac.cr/>

[[alternative HTML version deleted]]

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


[R-sig-Geo] Variance explained with the GSIF package

2018-06-25 Thread Manuel Spínola
Dear list members,

I am using the fit.gstatModel from the GSIF package.

I obtained 2 different values for variance explained using randomForest.
One is for the model and the other for the prediction.  What is the
difference among them and what is more important to report?

omm <- fit.gstatModel(meuse, om~dist+ffreq, meuse.grid,
method="randomForest")

> omm@regModel

Call:
 randomForest(formula = formulaString, data = rmatrix.s, importance =
TRUE,  na.action = na.omit)
   Type of random forest: regression
 Number of trees: 500
No. of variables tried at each split: 1

  Mean of squared residuals: 5.952434
% Var explained: 49.16


om.rk <- predict(omm, meuse.grid)

> show(om.rk)
  Variable   : om
  Minium value   : 1
  Maximum value  : 17
  Size   : 153
  Total area : 4964800
  Total area (units) : square-m
  Resolution (x) : 40
  Resolution (y) : 40
  Resolution (units) : m
  Vgm model  : Exp
  Nugget (residual)  : 2.78
  Sill (residual): 8.36
  Range (residual)   : 6100
  RMSE (validation)  : 1.672
  Var explained  : 76.1%
  Effective bytes: 1215
  Compression method : gzip

-- 
*Manuel Spínola, Ph.D.*
Instituto Internacional en Conservación y Manejo de Vida Silvestre
Universidad Nacional
Apartado 1350-3000
Heredia
COSTA RICA
mspin...@una.cr 
mspinol...@gmail.com
Teléfono: (506) 8706 - 4662
Personal website: Lobito de río <https://sites.google.com/site/lobitoderio/>
Institutional website: ICOMVIS <http://www.icomvis.una.ac.cr/>

[[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] Compatibility between sf and raster

2017-08-29 Thread Manuel Spínola
Thank you very much Edzer.

Manuel

2017-08-29 10:22 GMT-06:00 Edzer Pebesma <edzer.pebe...@uni-muenster.de>:

> Right now you'll have to be satisfied with doing
>
> raster(as(nc, "Spatial"))
>
> there is a follow-up project to sf, called stars [1], which will try to
> look beyond raster, rather than redo raster or make raster and sf
> compatible. Stars will consider compatibility with raster, but don't
> hold your breath.
>
> stars development will start soon.
>
> [1] https://github.com/r-spatial/stars
>
> On 29/08/17 17:03, Manuel Spínola wrote:
> > Dear list members,
> >
> > Is there any plan to make compatible the sf and the raster packages?
> >
> > library(sf)
> > library(raster)
> >
> >> nc <- st_read(system.file("shape/nc.shp", package="sf"))
> > Reading layer `nc' from data source
> > `/Library/Frameworks/R.framework/Versions/3.4/
> Resources/library/sf/shape/nc.shp'
> > using driver `ESRI Shapefile'
> > Simple feature collection with 100 features and 14 fields
> > geometry type:  MULTIPOLYGON
> > dimension:  XY
> > bbox:   xmin: -84.32385 ymin: 33.88199 xmax: -75.45698 ymax:
> > 36.58965
> > epsg (SRID):4267
> > proj4string:+proj=longlat +datum=NAD27 +no_defs
> >
> >> raster(nc)
> > Error in (function (classes, fdef, mtable)  :
> >   unable to find an inherited method for function ‘raster’ for signature
> > ‘"sf"’
> >
> >
> >
>
> --
> Edzer Pebesma
> Institute for Geoinformatics  (ifgi),  University of Münster
> Heisenbergstraße 2, 48149 Münster, Germany; +49 251 83 33081
> Journal of Statistical Software:   http://www.jstatsoft.org/
> Computers & Geosciences:   http://elsevier.com/locate/cageo/
>
>
> ___
> R-sig-Geo mailing list
> R-sig-Geo@r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>



-- 
*Manuel Spínola, Ph.D.*
Instituto Internacional en Conservación y Manejo de Vida Silvestre
Universidad Nacional
Apartado 1350-3000
Heredia
COSTA RICA
mspin...@una.cr <mspin...@una.ac.cr>
mspinol...@gmail.com
Teléfono: (506) 8706 - 4662
Personal website: Lobito de río <https://sites.google.com/site/lobitoderio/>
Institutional website: ICOMVIS <http://www.icomvis.una.ac.cr/>

[[alternative HTML version deleted]]

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

[R-sig-Geo] Compatibility between sf and raster

2017-08-29 Thread Manuel Spínola
Dear list members,

Is there any plan to make compatible the sf and the raster packages?

library(sf)
library(raster)

> nc <- st_read(system.file("shape/nc.shp", package="sf"))
Reading layer `nc' from data source
`/Library/Frameworks/R.framework/Versions/3.4/Resources/library/sf/shape/nc.shp'
using driver `ESRI Shapefile'
Simple feature collection with 100 features and 14 fields
geometry type:  MULTIPOLYGON
dimension:  XY
bbox:   xmin: -84.32385 ymin: 33.88199 xmax: -75.45698 ymax:
36.58965
epsg (SRID):4267
proj4string:+proj=longlat +datum=NAD27 +no_defs

> raster(nc)
Error in (function (classes, fdef, mtable)  :
  unable to find an inherited method for function ‘raster’ for signature
‘"sf"’



-- 
*Manuel Spínola, Ph.D.*
Instituto Internacional en Conservación y Manejo de Vida Silvestre
Universidad Nacional
Apartado 1350-3000
Heredia
COSTA RICA
mspin...@una.cr <mspin...@una.ac.cr>
mspinol...@gmail.com
Teléfono: (506) 8706 - 4662
Personal website: Lobito de río <https://sites.google.com/site/lobitoderio/>
Institutional website: ICOMVIS <http://www.icomvis.una.ac.cr/>

[[alternative HTML version deleted]]

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

[R-sig-Geo] Does ggmap work with sf objects through geom_sf?

2017-03-12 Thread Manuel Spínola
Dear list members,

Does ggmap work with sf objects through geom_sf?

I got the following error:

nc <- st_read(system.file("shape/nc.shp", package="sf"))

nclocation <- c(-80, 34)

ncmap <- get_map(location = nclocation, zoom = 6)

ggmap(ncmap) + geom_sf(data = nc)

Error in eval(expr, envir, enclos) : object 'lon' not found


-- 
*Manuel Spínola, Ph.D.*
Instituto Internacional en Conservación y Manejo de Vida Silvestre
Universidad Nacional
Apartado 1350-3000
Heredia
COSTA RICA
mspin...@una.cr <mspin...@una.ac.cr>
mspinol...@gmail.com
Teléfono: (506) 8706 - 4662
Personal website: Lobito de río <https://sites.google.com/site/lobitoderio/>
Institutional website: ICOMVIS <http://www.icomvis.una.ac.cr/>

[[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] Making an hexagonal grid using spsample

2017-03-06 Thread Manuel Spínola
Thank you very much Tim.

Manuel

2017-03-06 14:20 GMT-06:00 Tim Keitt <tke...@utexas.edu>:

>
> On Mon, Mar 6, 2017 at 2:18 PM, Tim Keitt <tke...@utexas.edu> wrote:
>
>> You might search the list
>
>
> https://stat.ethz.ch/pipermail/r-sig-geo/2007-March/001791.html
>
> http://www.keittlab.org/
>



-- 
*Manuel Spínola, Ph.D.*
Instituto Internacional en Conservación y Manejo de Vida Silvestre
Universidad Nacional
Apartado 1350-3000
Heredia
COSTA RICA
mspin...@una.cr <mspin...@una.ac.cr>
mspinol...@gmail.com
Teléfono: (506) 8706 - 4662
Personal website: Lobito de río <https://sites.google.com/site/lobitoderio/>
Institutional website: ICOMVIS <http://www.icomvis.una.ac.cr/>

[[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] Making an hexagonal grid using spsample

2017-03-06 Thread Manuel Spínola
Thank you very much Timothée.

That works.

Manuel

2017-03-06 9:42 GMT-06:00 Timothée Giraud <timothee.gir...@cnrs.fr>:

> Hi,
>
> I understand you find a solution via hextess from spatstat.
>
> However, this is a solution with spsample from sp.
>
> Actually, the cellsize argument of spsample defines the distance between
> the center of consecutives hexagons.
> So it is the length of 2 medians of one of the 6 equilateral triangles
> composing the hexagon.
>
> You can obtain the correct cellsize with:
> - the formula that calculates the median length for a given equilateral
> triangle length size,
> - the formula that calculate the area of an hexagon with a given side
> length.
>
>
> library(sp)
> data(meuse.grid)
> gridded(meuse.grid) = ~x+y
> plot(meuse.grid)
>
> # targeted area in meters
> A <- 1
> # Corresponding cellsize :
> CS <- 2 * sqrt(A/((3*sqrt(3)/2))) * sqrt(3)/2
>
> # hexagons
> HexPts <-spsample(x = meuse.grid, type = "hexagonal", cellsize = CS)
> HexPols <- HexPoints2SpatialPolygons(HexPts)
>
> plot(HexPols, add=TRUE)
>
> # check
> rgeos::gArea(HexPols, byid = T)[1:10]
>
>
>
>
> Since you asked me about getGridLayer via PM, this function of the
> cartography package uses spsample with its cellsize argument, maybe I
> should add a "targeted area" argument...
>
> ___
> R-sig-Geo mailing list
> R-sig-Geo@r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>



-- 
*Manuel Spínola, Ph.D.*
Instituto Internacional en Conservación y Manejo de Vida Silvestre
Universidad Nacional
Apartado 1350-3000
Heredia
COSTA RICA
mspin...@una.cr <mspin...@una.ac.cr>
mspinol...@gmail.com
Teléfono: (506) 8706 - 4662
Personal website: Lobito de río <https://sites.google.com/site/lobitoderio/>
Institutional website: ICOMVIS <http://www.icomvis.una.ac.cr/>

[[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] [FORGED] Re: Making an hexagonal grid using spsample

2017-03-04 Thread Manuel Spínola
Thank you very much to both.

Manuel

2017-03-04 6:35 GMT-06:00 Marcelino de la Cruz Rot <
marcelino.delac...@urjc.es>:

> My apologies for such a pair (or more) of embarrassing mistakes!
>
> I should read a bit more these days...
>
>
> Marcelino
>
>
>
>
> El 04/03/2017 a las 2:31, Rolf Turner escribió:
>
>> On 04/03/17 08:38, Marcelino de la Cruz Rot wrote:
>>
>>> Hi  Manuel,
>>>
>>> I do answer to the question "How can I make a spatial grid of 1 ha (or
>>> other size) in R?"
>>>
>>> You can use function hextess in spatstat
>>>
>>> library(spatstat)
>>>
>>> # some arbitrary area, with coordinates in hectometres
>>>  W <- Window(chorley)
>>>
>>> # As Rolf said, hexagons of 1ha should have side of 402.0673 metres, so,
>>> in hectometres:
>>>
>>> s <- 4.020673
>>>
>>> plot(hextess(W, s))
>>> plot(hexgrid(W, s), add=TRUE)
>>>
>>
>> Marcelino,
>>
>> Actually I said hexagons of area *42* ha should have side length equal to
>> 402.0673 metres.
>>
>> Moreover the Chorley data set has units of *kilometres* not hectometres,
>> so that should be s <- 0.4020673.  Or, to avoid just a touch of round-off
>> error, s <- sqrt(2*0.42)/3^0.75.
>>
>> Note that if you then do
>>
>> xxx <- hextess(W,s,trim=FALSE)
>> unique(sapply(tiles(xxx),area.owin))
>>
>> you get 0.42 --- i.e. 0.42 square kilometres, or 42 hectares.
>>
>> cheers,
>>
>> Rolf
>>
>>
>
> --
> Marcelino de la Cruz Rot
> Depto. de Biología y Geología
> Física y Química Inorgánica
> Universidad Rey Juan Carlos
> Móstoles España
>
>


-- 
*Manuel Spínola, Ph.D.*
Instituto Internacional en Conservación y Manejo de Vida Silvestre
Universidad Nacional
Apartado 1350-3000
Heredia
COSTA RICA
mspin...@una.cr <mspin...@una.ac.cr>
mspinol...@gmail.com
Teléfono: (506) 8706 - 4662
Personal website: Lobito de río <https://sites.google.com/site/lobitoderio/>
Institutional website: ICOMVIS <http://www.icomvis.una.ac.cr/>

[[alternative HTML version deleted]]

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

[R-sig-Geo] Making an hexagonal grid using spsample

2017-03-03 Thread Manuel Spínola
Dear list members,

I am trying to make an spatial hexagonal grid in R using the spsample
function. I would like hexagons of 1 ha = 1 sq meters.


First I used a cell size of 62.04 m as the side of the hexagon.

data(meuse.grid)
gridded(meuse.grid) = ~x + y
proj4string(meuse.grid) <- CRS("+init=epsg:28992")
xx <- spsample(meuse.grid, type = "hexagonal", cellsize = 62.04)
xx <- HexPoints2SpatialPolygons(xx)
rgeos::gArea(xx, byid=TRUE)

It gave me an area per hexagon = .299

Second I used a cell size of 62.04 * 2 = 124.08 m as the long diagonal of
the hexagon

data(meuse.grid)
gridded(meuse.grid) = ~x + y
proj4string(meuse.grid) <- CRS("+init=epsg:28992")
xx <- spsample(meuse.grid, type = "hexagonal", cellsize = 62.04*2)
xx <- HexPoints2SpatialPolygons(xx)
rgeos::gArea(xx, byid=TRUE)

It gave me an area per hexagon = 1.19

Both results are wrong, because I was expecting close to 1.

How can I make a spatial grid of 1 ha (or other size) in R?

Manuel

-- 
*Manuel Spínola, Ph.D.*
Instituto Internacional en Conservación y Manejo de Vida Silvestre
Universidad Nacional
Apartado 1350-3000
Heredia
COSTA RICA
mspin...@una.cr <mspin...@una.ac.cr>
mspinol...@gmail.com
Teléfono: (506) 8706 - 4662
Personal website: Lobito de río <https://sites.google.com/site/lobitoderio/>
Institutional website: ICOMVIS <http://www.icomvis.una.ac.cr/>

[[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] [FORGED] spsample: defining the size of the cell in an hexagonal grid

2017-03-02 Thread Manuel Spínola
Thank you very much Rolf.

Manuel

2017-03-01 2:03 GMT-06:00 Rolf Turner <r.tur...@auckland.ac.nz>:

> On 01/03/17 17:33, Manuel Spínola wrote:
>
>> Dear list members,
>>
>> How can I define the size in hectares of the cell when doingan hexagonal
>> grid with the function spsample.  What it means "cellsize"?  I want to
>> create cell sizes according to some specific number of hectares.  How can
>> I
>> do it?
>>
>>
>> data(meuse.grid)
>> gridded(meuse.grid) = ~x+y
>> plot(meuse.grid)
>> HexPts <-spsample(meuse.grid, type="hexagonal", cellsize=1000)
>> HexPols <- HexPoints2SpatialPolygons(HexPts)
>> plot(HexPols[meuse.grid,], add=TRUE)
>>
>
>
> I have no knowledge of spsample() nor of its argument cellsize (doesn't
> the help for spsample() tell you what this argument means?) but it might be
> useful for you to realise (if you are not already aware of this) that the
> area of a regular hexagon is
>
> A = 3*sqrt(3)*s^2/2
>
> where s is the length of side of the hexagon.  So if you want hexagons of
> area 42 hectares you would take their sides to be of length 402.0673 metres.
>
> cheers,
>
> Rolf Turner
>
> --
> Technical Editor ANZJS
> Department of Statistics
> University of Auckland
> Phone: +64-9-373-7599 ext. 88276
>



-- 
*Manuel Spínola, Ph.D.*
Instituto Internacional en Conservación y Manejo de Vida Silvestre
Universidad Nacional
Apartado 1350-3000
Heredia
COSTA RICA
mspin...@una.cr <mspin...@una.ac.cr>
mspinol...@gmail.com
Teléfono: (506) 8706 - 4662
Personal website: Lobito de río <https://sites.google.com/site/lobitoderio/>
Institutional website: ICOMVIS <http://www.icomvis.una.ac.cr/>

[[alternative HTML version deleted]]

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

[R-sig-Geo] spsample: defining the size of the cell in an hexagonal grid

2017-02-28 Thread Manuel Spínola
Dear list members,

How can I define the size in hectares of the cell when doingan hexagonal
grid with the function spsample.  What it means "cellsize"?  I want to
create cell sizes according to some specific number of hectares.  How can I
do it?


data(meuse.grid)
gridded(meuse.grid) = ~x+y
plot(meuse.grid)
HexPts <-spsample(meuse.grid, type="hexagonal", cellsize=1000)
HexPols <- HexPoints2SpatialPolygons(HexPts)
plot(HexPols[meuse.grid,], add=TRUE)


-- 
*Manuel Spínola, Ph.D.*
Instituto Internacional en Conservación y Manejo de Vida Silvestre
Universidad Nacional
Apartado 1350-3000
Heredia
COSTA RICA
mspin...@una.cr <mspin...@una.ac.cr>
mspinol...@gmail.com
Teléfono: (506) 8706 - 4662
Personal website: Lobito de río <https://sites.google.com/site/lobitoderio/>
Institutional website: ICOMVIS <http://www.icomvis.una.ac.cr/>

[[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 draw a legend when plotting sf (simple feature) objects

2017-02-26 Thread Manuel Spínola
Thank you very much Edzer,

it works for me:

> ggplot(nc) + geom_sf(aes(fill = SID79))
Warning message:
st_crs<- : replacing crs does not reproject data; use st_transform for that

2017-02-26 11:46 GMT-06:00 Edzer Pebesma <edzer.pebe...@uni-muenster.de>:

>
>
> On 26/02/17 13:23, Manuel Spínola wrote:
> > Dear list members,
> >
> > How can I draw a legend when plotting an sf (simple feature) object.
> >
> > nc = st_read(system.file("gpkg/nc.gpkg", package="sf"), quiet = TRUE)
> >
> > plot(nc["SID79"])
> >
>
> You're in base plot, so at this moment you can add elements
> incrementally to the plot, see e.g. ?legend.
>
> I have no plans of making this easy or automatic, because I don't think
> that base plot is the right place for it (although packages raster,
> spatstat and fields try hard), but would happily consider contributions.
>
> geom_sf in ggplot2 (now in sf branch on github) will follow up
> sp::spplot for sf objects; see e.g.
>
> https://github.com/edzer/sfr/issues/88#issuecomment-276738460
>
> nc <- sf::st_read(system.file("shape/nc.shp", package = "sf"), quiet =
> TRUE)
> ggplot(nc) + geom_sf(aes(fill = SID79))
>
> Trying this with the gpkg you read in above fails for me; it looks like
> ggplot now wrongly assumes that geometry columns are always called
> `geometry' (despite the docs), which is not the case.
> --
> Edzer Pebesma
> Institute for Geoinformatics  (ifgi),  University of Münster
> Heisenbergstraße 2, 48149 Münster, Germany; +49 251 83 33081
> Journal of Statistical Software:   http://www.jstatsoft.org/
> Computers & Geosciences:   http://elsevier.com/locate/cageo/
>
>
> ___
> R-sig-Geo mailing list
> R-sig-Geo@r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>



-- 
*Manuel Spínola, Ph.D.*
Instituto Internacional en Conservación y Manejo de Vida Silvestre
Universidad Nacional
Apartado 1350-3000
Heredia
COSTA RICA
mspin...@una.cr <mspin...@una.ac.cr>
mspinol...@gmail.com
Teléfono: (506) 8706 - 4662
Personal website: Lobito de río <https://sites.google.com/site/lobitoderio/>
Institutional website: ICOMVIS <http://www.icomvis.una.ac.cr/>

[[alternative HTML version deleted]]

___
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 draw a legend when plotting sf (simple feature) objects

2017-02-26 Thread Manuel Spínola
Dear list members,

How can I draw a legend when plotting an sf (simple feature) object.

nc = st_read(system.file("gpkg/nc.gpkg", package="sf"), quiet = TRUE)

plot(nc["SID79"])



Best,

-- 
*Manuel Spínola, Ph.D.*
Instituto Internacional en Conservación y Manejo de Vida Silvestre
Universidad Nacional
Apartado 1350-3000
Heredia
COSTA RICA
mspin...@una.cr <mspin...@una.ac.cr>
mspinol...@gmail.com
Teléfono: (506) 8706 - 4662
Personal website: Lobito de río <https://sites.google.com/site/lobitoderio/>
Institutional website: ICOMVIS <http://www.icomvis.una.ac.cr/>

[[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] Colors for factors in leaflet r

2017-02-12 Thread Manuel Spínola
Thank you very much Kent.

Manuel

2017-02-12 11:53 GMT-06:00 Kent Johnson <kent3...@gmail.com>:

> I think you want this:
>
> pal <- colorFactor(palette = c("red", "blue", "green"), levels =
> levels(meuse$soil))
> leaflet(meuse) %>%
>   addTiles() %>%
>   addCircleMarkers(stroke = FALSE, fillOpacity = 1, color = ~pal(soil)) %>%
>   addLegend("topright", pal, values=~soil, labels=c("Type 1", "Type 2",
> "Type 3"), title="Soil type")
>
> Kent
>
>
>> From: Manuel Sp?nola <mspinol...@gmail.com>
>> To: "r-sig-geo@r-project.org" <r-sig-geo@r-project.org>
>> Subject: [R-sig-Geo] Colors for factors in leaflet r
>>
>> I am trying to add a legend to a leaflet map but I got the following error
>>
>> data(meuse)
>> coordinates(meuse) <- ~x+y
>> proj4string(meuse) <- CRS("+init=epsg:28992")
>> WGS84 <- CRS("+proj=longlat +ellps=WGS84")
>> meuse <- spTransform(meuse, WGS84)
>>
>> pal <- colorFactor(palette = c("red", "blue", "green"), levels =
>> meuse$soil)
>> meuse$soil
>> leaflet(meuse) %>%
>>   addTiles() %>%
>>   addCircleMarkers(stroke = FALSE, fillOpacity = 1) %>%
>>   addLegend("topright", color = ~pal(soil), labels=c("Type 1", "Type 2",
>> "Type 3"), title="Soil type")
>
>


-- 
*Manuel Spínola, Ph.D.*
Instituto Internacional en Conservación y Manejo de Vida Silvestre
Universidad Nacional
Apartado 1350-3000
Heredia
COSTA RICA
mspin...@una.cr <mspin...@una.ac.cr>
mspinol...@gmail.com
Teléfono: (506) 8706 - 4662
Personal website: Lobito de río <https://sites.google.com/site/lobitoderio/>
Institutional website: ICOMVIS <http://www.icomvis.una.ac.cr/>

[[alternative HTML version deleted]]

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

[R-sig-Geo] Colors for factors in leaflet r

2017-02-10 Thread Manuel Spínola
Dear list members,

I am trying to add a legend to a leaflet map but I got the following error

data(meuse)
coordinates(meuse) <- ~x+y
proj4string(meuse) <- CRS("+init=epsg:28992")
WGS84 <- CRS("+proj=longlat +ellps=WGS84")
meuse <- spTransform(meuse, WGS84)

pal <- colorFactor(palette = c("red", "blue", "green"), levels = meuse$soil)
meuse$soil
leaflet(meuse) %>%
  addTiles() %>%
  addCircleMarkers(stroke = FALSE, fillOpacity = 1) %>%
  addLegend("topright", color = ~pal(soil), labels=c("Type 1", "Type 2",
"Type 3"), title="Soil type")

Duplicate levels detected
 Show Traceback
Error in addLegend(., "topright", color = ~pal(soil), labels = c("Type 1",
: 'colors' and 'labels' must be of the same length



Best,

Manuel

-- 
*Manuel Spínola, Ph.D.*
Instituto Internacional en Conservación y Manejo de Vida Silvestre
Universidad Nacional
Apartado 1350-3000
Heredia
COSTA RICA
mspin...@una.cr <mspin...@una.ac.cr>
mspinol...@gmail.com
Teléfono: (506) 8706 - 4662
Personal website: Lobito de río <https://sites.google.com/site/lobitoderio/>
Institutional website: ICOMVIS <http://www.icomvis.una.ac.cr/>

[[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] [FORGED] Selecting spatial points within spatial line segments

2017-02-09 Thread Manuel Spínola
Thank you very much Rolf.

Manuel

2017-02-08 17:06 GMT-06:00 Rolf Turner <r.tur...@auckland.ac.nz>:

> On 09/02/17 02:56, Manuel Spínola wrote:
>
>> Dear list members,
>>
>> I have a spatial line (a road) segmented in 500-meters segments.  I also
>> have spatial points (roadkills) and I want to select the points related to
>> each segment in the line.  The points do not touch (intersect) the line,
>> but are close to it. How can I do this in R?
>>
>
>
> The project2segment() function from the spatstat package will probably do
> what you want.
>
> cheers,
>
> Rolf Turner
>
> --
> Technical Editor ANZJS
> Department of Statistics
> University of Auckland
> Phone: +64-9-373-7599 ext. 88276
>



-- 
*Manuel Spínola, Ph.D.*
Instituto Internacional en Conservación y Manejo de Vida Silvestre
Universidad Nacional
Apartado 1350-3000
Heredia
COSTA RICA
mspin...@una.cr <mspin...@una.ac.cr>
mspinol...@gmail.com
Teléfono: (506) 8706 - 4662
Personal website: Lobito de río <https://sites.google.com/site/lobitoderio/>
Institutional website: ICOMVIS <http://www.icomvis.una.ac.cr/>

[[alternative HTML version deleted]]

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

[R-sig-Geo] Selecting spatial points within spatial line segments

2017-02-08 Thread Manuel Spínola
Dear list members,

I have a spatial line (a road) segmented in 500-meters segments.  I also
have spatial points (roadkills) and I want to select the points related to
each segment in the line.  The points do not touch (intersect) the line,
but are close to it. How can I do this in R?

Best,

Manuel

-- 
*Manuel Spínola, Ph.D.*
Instituto Internacional en Conservación y Manejo de Vida Silvestre
Universidad Nacional
Apartado 1350-3000
Heredia
COSTA RICA
mspin...@una.cr <mspin...@una.ac.cr>
mspinol...@gmail.com
Teléfono: (506) 8706 - 4662
Personal website: Lobito de río <https://sites.google.com/site/lobitoderio/>
Institutional website: ICOMVIS <http://www.icomvis.una.ac.cr/>

[[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] Landscape connectivity in R

2016-12-13 Thread Manuel Spínola
Thank you all.

Grainscape is great, but I think, is not being updated, so I don't know
what is going to happen with the package in the future, so I was looking
for new alternatives.

Manuel



2016-12-13 14:56 GMT-06:00 Chris Reudenbach <reudenb...@uni-marburg.de>:

> Hi Manuel,
>
> Probably you know  better than me that there are tons of papers dealing
> with this question out there. Unfortunately up to my mind your question
> focus a more a conceptual  (as described e.g. by Rudnick et al 2012
> Meiklejohn et al. 2012 or Kindlmann & Burel 2008) than a technical
> problem.  You can easily calculate this suggested metrics and measures
> with some R packages e.g. as the suggested ones. But as far as I got it you
> are looking for R-tools that magically ;-) connect these metrics/locations.
> Technically this is done by network analysis on graphs or cost analysis  on
> raster data.  If you want to do derive corridors the raster concept seems
> to be advantageous  because it provides zones or something like real areas
> (corridors).
>
> If you want to to it on a data set that is bigger than about 700*700
> pixels  and you do not want to rely on grainscape you should risk a glimpse
> on fully developed GIS Software packages like GRASS GIS. It provides
> powerful support for all kind of cost analysis . Your corridor problem is a
> a typical least cost path problem that needs a solid parametrization of the
> friction datasets and and landscape patterns as derived from the typical
> metrics. After this you can define your corridor analysis. If you are
> interested in an applied example you may have a look at github (
> https://github.com/gisma/robubu)  where you find  (among other stuff)  a
> simple example of an R-driven implemetation of a GRASS cost analysis to
> estimate the movement patterns and connectivity corridors of running beetle
> occurrences in high asia.
>
> cheers Chris
>
>
>
>
> On 13.12.2016 21:00, Jérome Mathieu wrote:
>
>> Hi Manuel,
>>
>> Perhaps the package "gdistance" can do what you're looking for.
>>
>> Jerome
>>
>> 2016-12-13 20:43 GMT+01:00 Manuel Spínola <mspinol...@gmail.com>:
>>
>> Thank you very much Forrest.
>>>
>>> I am looking for something different related to landscape connectivity
>>> (corredor design).  Your suggestion is more for landscape metrics for
>>> what
>>> I usually use the land.metrics function from the SpatialEco package for
>>> that.
>>>
>>> Best,
>>>
>>> Manuel
>>>
>>> 2016-12-13 13:31 GMT-06:00 Forrest Stevens <r-sig-...@forreststevens.com
>>> >:
>>>
>>> Check out sdmtools if fragstats like patch/class metrics are what you're
>>>> looking for: https://cran.r-project.org/web
>>>> /packages/SDMTools/index.html
>>>>
>>>> Sincerely,
>>>> Forrest
>>>>
>>>> On Tue, Dec 13, 2016 at 1:29 PM Manuel Spínola <mspinol...@gmail.com>
>>>> wrote:
>>>>
>>>> Dear list members,
>>>>>
>>>>> Is there any R package, besides grainscape, to assess landscape
>>>>> connectivity?
>>>>>
>>>>> Best,
>>>>>
>>>>> Manuel
>>>>>
>>>>> --
>>>>> *Manuel Spínola, Ph.D.*
>>>>> Instituto Internacional en Conservación y Manejo de Vida Silvestre
>>>>> Universidad Nacional
>>>>> Apartado 1350-3000
>>>>> Heredia
>>>>> COSTA RICA
>>>>> mspin...@una.cr <mspin...@una.ac.cr>
>>>>> mspinol...@gmail.com
>>>>> Teléfono: (506) 8706 - 4662
>>>>> Personal website: Lobito de río <https://sites.google.com/
>>>>> site/lobitoderio/>
>>>>> Institutional website: ICOMVIS <http://www.icomvis.una.ac.cr/>
>>>>>
>>>>>  [[alternative HTML version deleted]]
>>>>>
>>>>> ___
>>>>> R-sig-Geo mailing list
>>>>> R-sig-Geo@r-project.org
>>>>> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>>>>>
>>>>
>>>>
>>> --
>>> *Manuel Spínola, Ph.D.*
>>> Instituto Internacional en Conservación y Manejo de Vida Silvestre
>>> Universidad Nacional
>>> Apartado 1350-3000
>>> Heredia
>>> COSTA RICA
>>> mspin...@una.cr <mspin...@una.ac.cr>
>>> mspinol...@gmail.com
>>> Teléfono: (506) 8706 - 4

Re: [R-sig-Geo] Landscape connectivity in R

2016-12-13 Thread Manuel Spínola
Thank you very much Forrest.

I am looking for something different related to landscape connectivity
(corredor design).  Your suggestion is more for landscape metrics for what
I usually use the land.metrics function from the SpatialEco package for
that.

Best,

Manuel

2016-12-13 13:31 GMT-06:00 Forrest Stevens <r-sig-...@forreststevens.com>:

> Check out sdmtools if fragstats like patch/class metrics are what you're
> looking for: https://cran.r-project.org/web/packages/SDMTools/index.html
>
> Sincerely,
> Forrest
>
> On Tue, Dec 13, 2016 at 1:29 PM Manuel Spínola <mspinol...@gmail.com>
> wrote:
>
>> Dear list members,
>>
>> Is there any R package, besides grainscape, to assess landscape
>> connectivity?
>>
>> Best,
>>
>> Manuel
>>
>> --
>> *Manuel Spínola, Ph.D.*
>> Instituto Internacional en Conservación y Manejo de Vida Silvestre
>> Universidad Nacional
>> Apartado 1350-3000
>> Heredia
>> COSTA RICA
>> mspin...@una.cr <mspin...@una.ac.cr>
>> mspinol...@gmail.com
>> Teléfono: (506) 8706 - 4662
>> Personal website: Lobito de río <https://sites.google.com/
>> site/lobitoderio/>
>> Institutional website: ICOMVIS <http://www.icomvis.una.ac.cr/>
>>
>> [[alternative HTML version deleted]]
>>
>> ___
>> R-sig-Geo mailing list
>> R-sig-Geo@r-project.org
>> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>
>


-- 
*Manuel Spínola, Ph.D.*
Instituto Internacional en Conservación y Manejo de Vida Silvestre
Universidad Nacional
Apartado 1350-3000
Heredia
COSTA RICA
mspin...@una.cr <mspin...@una.ac.cr>
mspinol...@gmail.com
Teléfono: (506) 8706 - 4662
Personal website: Lobito de río <https://sites.google.com/site/lobitoderio/>
Institutional website: ICOMVIS <http://www.icomvis.una.ac.cr/>

[[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] Plotting simple features sf with ggplot2

2016-12-07 Thread Manuel Spínola
Thank you very much Edzer.

Manuel

2016-12-07 11:21 GMT-06:00 Edzer Pebesma <edzer.pebe...@uni-muenster.de>:

>
>
> On 07/12/16 17:49, Manuel Spínola wrote:
> > Dear list members,
> >
> > Is there a way to plot a simple features (sf) multipolygon (imported
> > shapefile) using ggplot2?
>
> Short answer is: not yet, I'm waiting for some help on this.
>
> There has been quite some discussion about this issue here:
>
> https://github.com/edzer/sfr/issues/88
> >
> > Similar to plotting a SpatialPolygonDataFrame  with ggplot2 using the
> > function fortify first to convert the SPDF to a data frame.
> >
>
> I think there is now a majority opinion that fortify is not such a good
> idea for simple feature (or in general: spatial) geometries.
>
> --
> Edzer Pebesma
> Institute for Geoinformatics  (ifgi),  University of Münster
> Heisenbergstraße 2, 48149 Münster, Germany; +49 251 83 33081
> Journal of Statistical Software:   http://www.jstatsoft.org/
> Computers & Geosciences:   http://elsevier.com/locate/cageo/
>
>
> _______
> R-sig-Geo mailing list
> R-sig-Geo@r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>



-- 
*Manuel Spínola, Ph.D.*
Instituto Internacional en Conservación y Manejo de Vida Silvestre
Universidad Nacional
Apartado 1350-3000
Heredia
COSTA RICA
mspin...@una.cr <mspin...@una.ac.cr>
mspinol...@gmail.com
Teléfono: (506) 8706 - 4662
Personal website: Lobito de río <https://sites.google.com/site/lobitoderio/>
Institutional website: ICOMVIS <http://www.icomvis.una.ac.cr/>

[[alternative HTML version deleted]]

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

[R-sig-Geo] Plotting simple features sf with ggplot2

2016-12-07 Thread Manuel Spínola
Dear list members,

Is there a way to plot a simple features (sf) multipolygon (imported
shapefile) using ggplot2?

Similar to plotting a SpatialPolygonDataFrame  with ggplot2 using the
function fortify first to convert the SPDF to a data frame.

Best,

Manuel


-- 
*Manuel Spínola, Ph.D.*
Instituto Internacional en Conservación y Manejo de Vida Silvestre
Universidad Nacional
Apartado 1350-3000
Heredia
COSTA RICA
mspin...@una.cr <mspin...@una.ac.cr>
mspinol...@gmail.com
Teléfono: (506) 8706 - 4662
Personal website: Lobito de río <https://sites.google.com/site/lobitoderio/>
Institutional website: ICOMVIS <http://www.icomvis.una.ac.cr/>

[[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] v.split.length (GRASS) in R

2016-11-24 Thread Manuel Spínola
Thank you very much Roger.



2016-11-24 8:09 GMT-06:00 Roger Bivand <roger.biv...@nhh.no>:

> On Thu, 24 Nov 2016, Manuel Spínola wrote:
>
> Thank you very much Roger.
>>
>> Sorry about that, I took the name from the Processing toolbox in QGIS and
>> I
>> assumed (wrongly)  that was the name in GRASS.
>>
>> I want to split a vector line (route) in equal contiguous segments of 500
>> m.
>>
>
> So for a Line object of 5km, you'd want 10 separate contiguous Line
> objects each of 500m in a Lines object? This would be the inverse operation
> to rgeos::gLineMerge(). sp::spsample can give n regular points on lines,
> but they are not a given distance apart (fixed distance, but n is given, n
> total points on the object. The code in spsample methods could give
> guidance. There are many edge cases, unfortunately, especially for typical
> input objects, which may not be clean. GRASS may be the best way of doing
> this, because it has a topological vector model, and will clean the lines
> on input.
>
> Roger
>
>
>
>> Manuel
>>
>> 2016-11-24 2:09 GMT-06:00 Roger Bivand <roger.biv...@nhh.no>:
>>
>> Before giving advice, please do ask for clarification. There is no
>>> v.split.length in GRASS at all, there is only v.split. Without a fully
>>> specified GRASS command, such as:
>>>
>>> v.split -n input=??, output=??, length=10.0, units="meters"
>>>
>>> which means add vertices each 10m, but do not split the vector line, we
>>> could think that the OP wants to divide a line into contiguous shorter
>>> segments. What does the OP actually want to do? Once we know that (which
>>> we
>>> do not), we can offer advice, including running the command in GRASS -
>>> which should be done anyway to ensure that the output of R-only
>>> approaches
>>> matches the desired output object.
>>>
>>> Roger
>>>
>>>
>>> On Wed, 23 Nov 2016, Manuel Spínola wrote:
>>>
>>> Dear list members,
>>>
>>>>
>>>> Is it possible to run v.split.length from GRASS in R? Or is there anyway
>>>> to
>>>> split a SpatialLinesDataFrame to shorter segments by length in R?
>>>>
>>>> Best,
>>>>
>>>> Manuel
>>>>
>>>> --
>>>> *Manuel Spínola, Ph.D.*
>>>> Instituto Internacional en Conservación y Manejo de Vida Silvestre
>>>> Universidad Nacional
>>>> Apartado 1350-3000
>>>> Heredia
>>>> COSTA RICA
>>>> mspin...@una.cr <mspin...@una.ac.cr>
>>>> mspinol...@gmail.com
>>>> Teléfono: (506) 8706 - 4662
>>>> Personal website: Lobito de río <https://sites.google.com/site
>>>> /lobitoderio/>
>>>> Institutional website: ICOMVIS <http://www.icomvis.una.ac.cr/>
>>>>
>>>> [[alternative HTML version deleted]]
>>>>
>>>> ___
>>>> R-sig-Geo mailing list
>>>> R-sig-Geo@r-project.org
>>>> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>>>>
>>>>
>>> --
>>> Roger Bivand
>>> Department of Economics, Norwegian School of Economics,
>>> Helleveien 30, N-5045 Bergen, Norway.
>>> voice: +47 55 95 93 55; fax +47 55 95 91 00
>>> e-mail: roger.biv...@nhh.no
>>> http://orcid.org/-0003-2392-6140
>>> https://scholar.google.no/citations?user=AWeghB0J=en
>>> http://depsy.org/person/434412
>>>
>>
>>
>>
>>
>>
>>
> --
> Roger Bivand
> Department of Economics, Norwegian School of Economics,
> Helleveien 30, N-5045 Bergen, Norway.
> voice: +47 55 95 93 55; fax +47 55 95 91 00
> e-mail: roger.biv...@nhh.no
> http://orcid.org/-0003-2392-6140
> https://scholar.google.no/citations?user=AWeghB0J=en
> http://depsy.org/person/434412
>



-- 
*Manuel Spínola, Ph.D.*
Instituto Internacional en Conservación y Manejo de Vida Silvestre
Universidad Nacional
Apartado 1350-3000
Heredia
COSTA RICA
mspin...@una.cr <mspin...@una.ac.cr>
mspinol...@gmail.com
Teléfono: (506) 8706 - 4662
Personal website: Lobito de río <https://sites.google.com/site/lobitoderio/>
Institutional website: ICOMVIS <http://www.icomvis.una.ac.cr/>

[[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] v.split.length (GRASS) in R

2016-11-24 Thread Manuel Spínola
Thank you Jannes,

I installed the QGIS LTR, but I got the following error:

qgis_env <- set_env("C:/Program Files/QGIS 2.14")

ruta <- readOGR(dsn = ".", layer = "Ruta32_CRTM05_FINAL")

args <- get_args_man("grass7:v.split.length", qgis_env = qgis_env, options
= TRUE)

args$input <- ruta

args$length <- 500

args$output <- "ruta_s.shp"

out <- run_qgis(alg = "grass7:v.split.length", params = args, load_output =
args$output, qgis_env = qgis_env)

Error in .local(.Object, ...) :

 Show Traceback
Error in .rasterObjectFromFile(x, band = band, objecttype = "RasterLayer",
: Cannot create a RasterLayer object from this file. (file does not exist)












2016-11-24 3:43 GMT-06:00 "Jannes Münchow" <malnama...@gmx.de>:

> Hi Manuel,
>
> overall we recommend to use RQGIS with the long-term release of QGIS
> (2.14). Nevertheless, RQGIS works also with QGIS 2.18. However, there is a
> bug in the QGIS Python code. Therefore, one needs to manually change the
> Python code. Here you find how you can do that:
>
> https://github.com/jannes-m/RQGIS#qgis-216-modifications.
>
> Regarding this issue, we have already notified the QGIS developers, and
> they told us that they fixed the issue. Hence, with the release of the next
> QGIS patch release, the manual adjustment of the Python code should no
> longer be necessary.
>
> Best regards,
>
> Jannes
>
>
>
>
> *Gesendet:* Mittwoch, 23. November 2016 um 20:49 Uhr
> *Von:* "Manuel Spínola" <mspinol...@gmail.com>
> *An:* "Jannes Münchow" <malnama...@gmx.de>
> *Cc:* "r-sig-geo@r-project.org" <r-sig-geo@r-project.org>
> *Betreff:* Re: [R-sig-Geo] v.split.length (GRASS) in R
> Thank you very much Jannes.
>
> Does the example works with QGIS 2.18 or should I do some setting in QGIS
> before running the code?
>
> Manuel
>
> 2016-11-23 8:45 GMT-06:00 "Jannes Münchow" <malnama...@gmx.de>:
>>
>> To achieve this, you can also use the RQGIS-package in conjunction with
>> GRASS given you have installed QGIS along with GRASS (for more information
>> have a look at vignette("install_guide", package = "RQGIS"):
>>
>> # construct a SpatialPointsDataFrame (which will be accepted as input by
>> # run_qgis)
>> library("sp")
>> # from the sp vignette:
>> l1 <- cbind(c(1, 2, 3), c(3, 2, 2))
>> rownames(l1) <- letters[1:3]
>> l1a <- cbind(l1[, 1] + 0.05, l1[, 2] + 0.05)
>> rownames(l1a) <- letters[1:3]
>> l2 <- cbind(c(1, 2, 3), c(1, 1.5, 1))
>> rownames(l2) <- letters[1:3]
>> Sl1 <- Line(l1)
>> Sl1a <- Line(l1a)
>> Sl2 <- Line(l2)
>> S1 <- Lines(list(Sl1, Sl1a), ID = "a")
>> S2 <- Lines(list(Sl2), ID = "b")
>> Sl <- SpatialLines(list(S1, S2))
>> # convert it to a SpatialLinesDataFrame
>> Sl <- SpatialLinesDataFrame(Sl, data = data.frame(1:2), match.ID = FALSE)
>> proj4string(Sl) <- CRS("+proj=longlat +datum=WGS84")
>>
>> # Now use RQGIS
>> library("RQGIS")
>> # indicate where QGIS is installed on your computer
>> qgis_env <- set_env("C:/OSGeo4W64/")
>> args <- get_args_man("grass7:v.split.length", qgis_env = qgis_env,
>>  options = TRUE)
>> # have a look at the GRASS online help
>> open_help("grass7:v.split.length", qgis_env = qgis_env)
>>
>> # specify the necessary arguments
>> args$input <- Sl
>> # here length corresponds to one decimal degree
>> args$length <- "1"
>> args$output <- file.path(tempdir(), "out.shp")
>> # load the output directly into R again
>> out <- run_qgis(alg = "grass7:v.split.length", params = args,
>> load_output = args$output,
>> qgis_env = qgis_env)
>> length(Sl)  # 2 line objects
>> length(out)  #  9 line objects
>> # Have a look at the output
>> plot(out, col = rep(c("blue", "green", "black"), 3))
>>
>> Cheers,
>>
>> Jannes
>>
>> ___
>> R-sig-Geo mailing list
>> R-sig-Geo@r-project.org
>> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>
>
>
> --
> *Manuel Spínola, Ph.D.*
> Instituto Internacional en Conservación y Manejo de Vida Silvestre
> Universidad Nacional
> Apartado 1350-3000
> Heredia
> COSTA RICA
> mspin...@una.cr <mspin...@una.ac.cr>
> mspinol...@gmail.com
> Teléfono: (506) 8706 - 4662
> Personal website: Lobito de río
> <https://sites.google.com/site/lobitoderio/>
> Institutional website: ICOMVIS <http://www.icomvis.una.ac.cr/>
>



-- 
*Manuel Spínola, Ph.D.*
Instituto Internacional en Conservación y Manejo de Vida Silvestre
Universidad Nacional
Apartado 1350-3000
Heredia
COSTA RICA
mspin...@una.cr <mspin...@una.ac.cr>
mspinol...@gmail.com
Teléfono: (506) 8706 - 4662
Personal website: Lobito de río <https://sites.google.com/site/lobitoderio/>
Institutional website: ICOMVIS <http://www.icomvis.una.ac.cr/>

[[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] v.split.length (GRASS) in R

2016-11-24 Thread Manuel Spínola
Thank you very much Roger.

Sorry about that, I took the name from the Processing toolbox in QGIS and I
assumed (wrongly)  that was the name in GRASS.

I want to split a vector line (route) in equal contiguous segments of 500 m.

Manuel

2016-11-24 2:09 GMT-06:00 Roger Bivand <roger.biv...@nhh.no>:

> Before giving advice, please do ask for clarification. There is no
> v.split.length in GRASS at all, there is only v.split. Without a fully
> specified GRASS command, such as:
>
> v.split -n input=??, output=??, length=10.0, units="meters"
>
> which means add vertices each 10m, but do not split the vector line, we
> could think that the OP wants to divide a line into contiguous shorter
> segments. What does the OP actually want to do? Once we know that (which we
> do not), we can offer advice, including running the command in GRASS -
> which should be done anyway to ensure that the output of R-only approaches
> matches the desired output object.
>
> Roger
>
>
> On Wed, 23 Nov 2016, Manuel Spínola wrote:
>
> Dear list members,
>>
>> Is it possible to run v.split.length from GRASS in R? Or is there anyway
>> to
>> split a SpatialLinesDataFrame to shorter segments by length in R?
>>
>> Best,
>>
>> Manuel
>>
>> --
>> *Manuel Spínola, Ph.D.*
>> Instituto Internacional en Conservación y Manejo de Vida Silvestre
>> Universidad Nacional
>> Apartado 1350-3000
>> Heredia
>> COSTA RICA
>> mspin...@una.cr <mspin...@una.ac.cr>
>> mspinol...@gmail.com
>> Teléfono: (506) 8706 - 4662
>> Personal website: Lobito de río <https://sites.google.com/site
>> /lobitoderio/>
>> Institutional website: ICOMVIS <http://www.icomvis.una.ac.cr/>
>>
>> [[alternative HTML version deleted]]
>>
>> ___
>> R-sig-Geo mailing list
>> R-sig-Geo@r-project.org
>> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>>
>
> --
> Roger Bivand
> Department of Economics, Norwegian School of Economics,
> Helleveien 30, N-5045 Bergen, Norway.
> voice: +47 55 95 93 55; fax +47 55 95 91 00
> e-mail: roger.biv...@nhh.no
> http://orcid.org/-0003-2392-6140
> https://scholar.google.no/citations?user=AWeghB0J=en
> http://depsy.org/person/434412




-- 
*Manuel Spínola, Ph.D.*
Instituto Internacional en Conservación y Manejo de Vida Silvestre
Universidad Nacional
Apartado 1350-3000
Heredia
COSTA RICA
mspin...@una.cr <mspin...@una.ac.cr>
mspinol...@gmail.com
Teléfono: (506) 8706 - 4662
Personal website: Lobito de río <https://sites.google.com/site/lobitoderio/>
Institutional website: ICOMVIS <http://www.icomvis.una.ac.cr/>

[[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] v.split.length (GRASS) in R

2016-11-23 Thread Manuel Spínola
Thank you very much Jannes.

Does the example works with QGIS 2.18 or should I do some setting in QGIS
before running the code?

Manuel

2016-11-23 8:45 GMT-06:00 "Jannes Münchow" <malnama...@gmx.de>:

> To achieve this, you can also use the RQGIS-package in conjunction with
> GRASS given you have installed QGIS along with GRASS (for more information
> have a look at vignette("install_guide", package = "RQGIS"):
>
> # construct a SpatialPointsDataFrame (which will be accepted as input by
> # run_qgis)
> library("sp")
> # from the sp vignette:
> l1 <- cbind(c(1, 2, 3), c(3, 2, 2))
> rownames(l1) <- letters[1:3]
> l1a <- cbind(l1[, 1] + 0.05, l1[, 2] + 0.05)
> rownames(l1a) <- letters[1:3]
> l2 <- cbind(c(1, 2, 3), c(1, 1.5, 1))
> rownames(l2) <- letters[1:3]
> Sl1 <- Line(l1)
> Sl1a <- Line(l1a)
> Sl2 <- Line(l2)
> S1 <- Lines(list(Sl1, Sl1a), ID = "a")
> S2 <- Lines(list(Sl2), ID = "b")
> Sl <- SpatialLines(list(S1, S2))
> # convert it to a SpatialLinesDataFrame
> Sl <- SpatialLinesDataFrame(Sl, data = data.frame(1:2), match.ID = FALSE)
> proj4string(Sl) <- CRS("+proj=longlat +datum=WGS84")
>
> # Now use RQGIS
> library("RQGIS")
> # indicate where QGIS is installed on your computer
> qgis_env <- set_env("C:/OSGeo4W64/")
> args <- get_args_man("grass7:v.split.length", qgis_env = qgis_env,
>  options = TRUE)
> # have a look at the GRASS online help
> open_help("grass7:v.split.length", qgis_env = qgis_env)
>
> # specify the necessary arguments
> args$input <- Sl
> # here length corresponds to one decimal degree
> args$length <- "1"
> args$output <- file.path(tempdir(), "out.shp")
> # load the output directly into R again
> out <- run_qgis(alg = "grass7:v.split.length", params = args,
> load_output = args$output,
> qgis_env = qgis_env)
> length(Sl)  # 2 line objects
> length(out)  #  9 line objects
> # Have a look at the output
> plot(out, col = rep(c("blue", "green", "black"), 3))
>
> Cheers,
>
> Jannes
>
> ___
> R-sig-Geo mailing list
> R-sig-Geo@r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo




-- 
*Manuel Spínola, Ph.D.*
Instituto Internacional en Conservación y Manejo de Vida Silvestre
Universidad Nacional
Apartado 1350-3000
Heredia
COSTA RICA
mspin...@una.cr <mspin...@una.ac.cr>
mspinol...@gmail.com
Teléfono: (506) 8706 - 4662
Personal website: Lobito de río <https://sites.google.com/site/lobitoderio/>
Institutional website: ICOMVIS <http://www.icomvis.una.ac.cr/>

[[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] v.split.length (GRASS) in R

2016-11-23 Thread Manuel Spínola
Thank you very much Florian.

Do you know any R function/package to do the same without relying on GRASS?

Manuel

2016-11-23 7:28 GMT-06:00 Florian Betz <flob...@web.de>:

> Assuming you are using GRASS 7, you can use the rgrass7 package. First
> thing to do is to initialize the R-GRASS connection, then you can run the
> module using execGRASS.
>
> library(rgrass7)
> #Arguments depending on your system
> initGRASS(gisBase ="C:/Program Files/GRASS GIS 7.0.5",home=tempdir(),
>   gisDbase="Path to the folder with your location, location="Your
> GRASS location",mapset="Your GRASS mapset",override=TRUE)
> #See the help of v.split.lenght for the necessary function arguments
> execGRASS("v.split.length", argument1=, argument2=, ...)
>
> Regards,
>
> Flo
>
>
> Am 23.11.2016 um 14:15 schrieb Manuel Spínola:
>
>> Dear list members,
>>
>> Is it possible to run v.split.length from GRASS in R? Or is there anyway
>> to
>> split a SpatialLinesDataFrame to shorter segments by length in R?
>>
>> Best,
>>
>> Manuel
>>
>>
>


-- 
*Manuel Spínola, Ph.D.*
Instituto Internacional en Conservación y Manejo de Vida Silvestre
Universidad Nacional
Apartado 1350-3000
Heredia
COSTA RICA
mspin...@una.cr <mspin...@una.ac.cr>
mspinol...@gmail.com
Teléfono: (506) 8706 - 4662
Personal website: Lobito de río <https://sites.google.com/site/lobitoderio/>
Institutional website: ICOMVIS <http://www.icomvis.una.ac.cr/>

[[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 read .gpkg (Geopackage) files in R

2016-08-25 Thread Manuel Spínola
Thank you very much Michael.

Manuel

2016-08-25 16:40 GMT-06:00 Michael Sumner <mdsum...@gmail.com>:

>
>
> On Fri, 26 Aug 2016 at 07:18 Manuel Spínola <mspinol...@gmail.com> wrote:
>
>> Dear list members,
>>
>> How can I read a .gpkg (Geopackage) file in R?
>>
>>
> You're in luck because it's extremely easy.
>
> library(rgdal)
> layers <- ogrListLayers("parcelas.gpkg")
>
> ## you may have more than one layer
> x <- readOGR("parcelas.gpkg", layers[1])
>
> ## some kind of *DataFrame
> print(class(x))
> plot(x)
>
> Cheers, Mike.
>
> Read on only  if you're interested in more details about GeoPackage.
>
> Geopackage is also extremely extensible since it's built right on top of
> SQLite.  If you are keen, you can investigate the contents with
> dplyr/RSQLite - though there's no need if sp/rgdal does what you want:
>
> library(dplyr)
> library(RSQLite)
> db <- src_sql("parcelas.gpkg")
>
> print(db)  ## what tabes are in there?
>
> tbl_df(db, "some_table_name")
>
> The geometry is in one of the tables in WKB form, so it's not "tables all
> the way down" but still pretty useful.
>
>
>
>> The name of my file is: parcelas.gpkg
>>
>> Best,
>>
>> --
>> *Manuel Spínola, Ph.D.*
>> Instituto Internacional en Conservación y Manejo de Vida Silvestre
>> Universidad Nacional
>> Apartado 1350-3000
>> Heredia
>> COSTA RICA
>> mspin...@una.cr <mspin...@una.ac.cr>
>> mspinol...@gmail.com
>> Teléfono: (506) 8706 - 4662
>> Personal website: Lobito de río <https://sites.google.com/
>> site/lobitoderio/>
>> Institutional website: ICOMVIS <http://www.icomvis.una.ac.cr/>
>>
>> [[alternative HTML version deleted]]
>>
>> ___
>> R-sig-Geo mailing list
>> R-sig-Geo@r-project.org
>> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>
> --
> Dr. Michael Sumner
> Software and Database Engineer
> Australian Antarctic Division
> 203 Channel Highway
> Kingston Tasmania 7050 Australia
>
>


-- 
*Manuel Spínola, Ph.D.*
Instituto Internacional en Conservación y Manejo de Vida Silvestre
Universidad Nacional
Apartado 1350-3000
Heredia
COSTA RICA
mspin...@una.cr <mspin...@una.ac.cr>
mspinol...@gmail.com
Teléfono: (506) 8706 - 4662
Personal website: Lobito de río <https://sites.google.com/site/lobitoderio/>
Institutional website: ICOMVIS <http://www.icomvis.una.ac.cr/>

[[alternative HTML version deleted]]

___
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 read .gpkg (Geopackage) files in R

2016-08-25 Thread Manuel Spínola
Dear list members,

How can I read a .gpkg (Geopackage) file in R?

The name of my file is: parcelas.gpkg

Best,

-- 
*Manuel Spínola, Ph.D.*
Instituto Internacional en Conservación y Manejo de Vida Silvestre
Universidad Nacional
Apartado 1350-3000
Heredia
COSTA RICA
mspin...@una.cr <mspin...@una.ac.cr>
mspinol...@gmail.com
Teléfono: (506) 8706 - 4662
Personal website: Lobito de río <https://sites.google.com/site/lobitoderio/>
Institutional website: ICOMVIS <http://www.icomvis.una.ac.cr/>

[[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 do square buffers around spatial points

2016-08-25 Thread Manuel Spínola
Thank you very much for both answers.

Manuel

2016-08-25 7:36 GMT-06:00 Barry Rowlingson <b.rowling...@lancaster.ac.uk>:

> Here's a one-liner:
>
> # for some SpatialPointsDataFrame `d`, and some half-width `w`, this
> produces a set of square SpatialPolygons
> # with square height and width equal to 2*w:
>
> polys = SpatialPolygons(apply(apply(coordinates(d),1,function(r){
> cbind(r+c(w,w),r+c(w,-w),r+c(-w,-w),r+c(-w,w),r+c(w,w))}),2,
> function(v){Polygons(list(Polygon(matrix(v,ncol=2,byrow=
> TRUE))),ID=runif(1))}))
>
>  > plot(polys)
>  > plot(d,add=TRUE)
>
> Barry
>
>
>
> On Thu, Aug 25, 2016 at 2:11 PM, Barry Rowlingson
> <b.rowling...@lancaster.ac.uk> wrote:
> > 2016-08-25 13:01 GMT+01:00 Manuel Spínola <mspinol...@gmail.com>:
> >> Dear list members,
> >>
> >> Ho can I do square buffers around spatial points?
> >
> > Break it down:
> >
> > 1. For each point compute the coordinates of the four corners of the
> > square by adding half the width of your square.
> > 2. Construct a Polygon from those four points for each of your source
> points.
> > 3. Build a SpatialPolygons object from all your Polygons.
> >
> > How far can you get with it now?
> >
> > Barry
>



-- 
*Manuel Spínola, Ph.D.*
Instituto Internacional en Conservación y Manejo de Vida Silvestre
Universidad Nacional
Apartado 1350-3000
Heredia
COSTA RICA
mspin...@una.cr <mspin...@una.ac.cr>
mspinol...@gmail.com
Teléfono: (506) 8706 - 4662
Personal website: Lobito de río <https://sites.google.com/site/lobitoderio/>
Institutional website: ICOMVIS <http://www.icomvis.una.ac.cr/>

[[alternative HTML version deleted]]

___
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 do square buffers around spatial points

2016-08-25 Thread Manuel Spínola
Dear list members,

Ho can I do square buffers around spatial points?

Best,

Manuel

-- 
*Manuel Spínola, Ph.D.*
Instituto Internacional en Conservación y Manejo de Vida Silvestre
Universidad Nacional
Apartado 1350-3000
Heredia
COSTA RICA
mspin...@una.cr <mspin...@una.ac.cr>
mspinol...@gmail.com
Teléfono: (506) 8706 - 4662
Personal website: Lobito de río <https://sites.google.com/site/lobitoderio/>
Institutional website: ICOMVIS <http://www.icomvis.una.ac.cr/>

[[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] A Qgis Map Graphics Device for R

2016-08-18 Thread Manuel Spínola
Dear Barry,

How I install the package?

Manuel

2016-08-17 1:40 GMT-06:00 Barry Rowlingson <b.rowling...@lancaster.ac.uk>:

> Time to announce my little summer side project...
>
> `pqgisr` is a *highly* experimental package to provide an easy way for
> R programmers to use the cartographic features of Qgis without the
> hassle of exporting objects, loading them into Qgis, and then having
> to style them.
>
> The package provides functions for adding map data from SP-class
> objects, OGR, and GDAL data sources as well as basemap tile layers to
> a Qgis map canvas window. Note that a full Qgis application is not
> running - just a map canvas launched from R via python code. The
> canvas is embedded in a small application with a little functionality
> for layer styling, ordering, zooming etc.  This gives you an
> interactive map for exploring spatial data.
>
> In this way I also hope to have a solution for reproducible map
> graphics from R using the Qgis graphics engine. An R script, possibly
> running in a knitr document, can add map data to the canvas, style it
> either via simple R calls or using Qgis XML styling files created
> elsewhere, then save as an image and include in a reproducible
> document. Yes you could do all this via R graphics commands but the
> Qgis map canvas has some features that are not available on R graphics
> devices.
>
> I started this project when I noticed the RQGIS project could have
> been implemented using `rPython`, which embeds a python interpreter
> instance in the R process, instead of launching separate python
> processes every time. As I considered reimplementing RQGIS using
> rPython I realised my time would be better spent doing something that
> couldn't be easily done using the process approach, and worked on
> embedding a Qgis application in R via rPython. This also fit well with
> my usual workflow which is to do all my GIS analysis in R (using rgeos
> etc) but then exporting to Qgis for mapping. That export/import step
> really jarred.
>
> I appreciate the work the RQGIS developers are doing and see `pqgisr`
> as complementary to their approach. Running Qgis `processing`
> algorithms is not on my TODO list for now, I'm concentrating on the
> interactive graphics aspects.
>
> The problem with my dependence on rPython is that there seems to be no
> Windows version at the moment. Oh well.
>
> The code is on gitlab:
>
> https://gitlab.com/b-rowlingson/pqgisr
>
> You'll need some dev skills to get it running, and I'd be interested
> to hear success stories (failure stories less so, I *expect* it to
> fail at this stage!). Documentation is almost non-existent, the README
> is a bit out of date (there's more implemented functionality now), and
> it will crash R if you try initialising Qgis twice. I'm also
> considering changing the API, and a lot of the internals which might
> simplify things and clear out some of the cruft from the earliest
> versions which were mostly hacking at it to make something work.
>
> Suggestions welcome via the project gitlab tracker please!
>
>https://gitlab.com/b-rowlingson/pqgisr/issues
>
>
> Barry
>
> ___
> R-sig-Geo mailing list
> R-sig-Geo@r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>



-- 
*Manuel Spínola, Ph.D.*
Instituto Internacional en Conservación y Manejo de Vida Silvestre
Universidad Nacional
Apartado 1350-3000
Heredia
COSTA RICA
mspin...@una.cr <mspin...@una.ac.cr>
mspinol...@gmail.com
Teléfono: (506) 8706 - 4662
Personal website: Lobito de río <https://sites.google.com/site/lobitoderio/>
Institutional website: ICOMVIS <http://www.icomvis.una.ac.cr/>

[[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] Estimation of utilization distribution and home range within a polygon

2016-08-16 Thread Manuel Spínola
Thank you very much Michael and Tom.

Best,

Manuel

2016-08-15 17:18 GMT-06:00 Tom Philippi <tephili...@gmail.com>:

> Manuel--
> I don't think that there is one single "right" method for estimating
> homeranges or spatial utilization contours with spatial boundaries.
>
> Before deciding on the computations, I would encourage you to carefully
> think about and define how movement & spatial utilization react to the
> polygon boundaries.  Are the boundaries the equivalent of a sheer wall,
> where individuals use space normally right up to the boundary, or is there
> a gradient of repulsion extending some (short) distance from the boundary
> (e.g., too shallow water) so use drops off a bit before the boundary, or is
> the boundary attractive or reflecting, where potential movements across the
> boundary become repeated head-banging against the boundary (e.g., desert
> tortoises and other herps hitting drift fences)?
>
> At the micro-scale, your pdf from each fish position is something like a
> 2-d Epanechnikov or normal bump of volume 1/N.  If that bump spans (or even
> gets near to) your boundary, you probably want the volume to remain 1/N.
> The options may be to clip at the boundary & renormalize by a scalar to
> retain 1/N, or shift to an anisotropic kernel elongated along the
> boundary.  Just doing the full  kernelling and then clipping the homerange
> reduces the weight given to that observation near the boundary relative to
> the other observations, biasing your estimated utilization away from the
> edges.  For places like the Everglades where water depth, nutrients, and
> vegetation are very different near the edges of wetland compartments, that
> bias would be seriously misleading.
>
>  Perhaps none of this matters for the spatial scales of your fish,
> boundary effects in your wetlands, and the frequency of position locations
> of individual fish (with 1000 observations per fish, fractionally
> downweighting a couple of observations has little effect).
>
> My suggestion can be thought of as an expansion of Mike's: "You can just
> clip after the fact, but as you surely know that defeats the
> purpose if the boundary has meaning to the intensity of behaviour" above
> to cases beyond just clipping.  Mike is both more succinct and faster at
> responding than I am.
>
> Tom 2
>
> On Mon, Aug 15, 2016 at 8:38 AM, Michael Sumner <mdsum...@gmail.com>
> wrote:
>
>> It sounds like maybe your input constraint is not in a form that kernelUD
>> likes, perhaps there is room to read about the error message and explore
>> the details?
>>
>> You otherwise will need more specialist methods to model within a complex
>> boundary.
>>
>> The soapfilm tools in mgcv is one example:
>> http://www.fromthebottomoftheheap.net/2016/03/27/soap-film-smoothers/
>>
>> Some of the trajectory/ tracking packages probably have stuff, review the
>> packages in the list here:
>>
>> https://cloud.r-project.org/web/views/SpatioTemporal.html
>>
>> There are few other related packages on CRAN from recent times not on that
>> list, and many there have had some significant development so worth
>> exploring.
>>
>> You can just clip after the fact, but as you surely know that defeats the
>> purpose if the boundary has meaning to the intensity of behaviour.
>>
>> (tripEstimation does facilitate this generally,  but I'd say that's much
>> too specialist and buried too deep to be helpful).
>>
>> Cheers, Mike.
>>
>> On Tue, 16 Aug 2016 at 01:08 Manuel Spínola <mspinol...@gmail.com> wrote:
>>
>> > Dear list members,
>> >
>> > Is there a way to estimate utilization distribution and home range area
>> > within a polygon.  I am working with spatial location on a fish in a
>> > wetland but the utilization distribution and the home range cannot go
>> > outside the water boundary.
>> >
>> > I tried using a spatial polygon as spatial line and specify this in the
>> > boundary argument of the kernelUD function of the adehabitatHR package
>> but
>> > I got an error:
>> >
>> > > ud = kernelUD(dfs_in[,2], h="href", grid = 100, boundary = riol)
>> >
>> > Error in .boundaryk(SpatialPoints(x, proj4string =
>> > CRS(as.character(pfs1))),  :
>> >   non convenient boundary: turning angles > pi/2
>> >
>> > "riol" is the spatial polygon coerced to spatial line
>> >
>> > Thank you very much in advance
>> >
>> > Manuel
>> >
>> > --
>> > *Manuel Spínola, Ph.D.*
>> > Ins

Re: [R-sig-Geo] RQGIS 0.1.0 release

2016-08-16 Thread Manuel Spínola
Thank you very much Jannes.

I tried to install RQGIS but I got this warning message:

> install.packages("RQGIS")
Installing package into ‘C:/Users/mspin/Documents/R/win-library/3.3’
(as ‘lib’ is unspecified)
Warning in install.packages :
  package ‘RQGIS’ is not available (for R version 3.3.1)

Best,

Manuel

2016-08-15 15:59 GMT-06:00 "Jannes Münchow" <malnama...@gmx.de>:

> Dear R-GIS community,
>
> We proudly announce the release of RQGIS! RQGIS establishes an interface
> between R and QGIS, i.e. it allows the user to access the more than 1000
> QGIS geoalgorithms from within R. To install it, run:
>
> install.packages("RQGIS")
>
> To find out more about RQGIS and how to use it, please visit:
>
> https://jannesm.wordpress.com/2016/08/15/rqgis-0-1-0-release/
>
> and/or
>
> https://github.com/jannes-m/RQGIS
>
> All the best,
>
> Jannes
>
> ___
> R-sig-Geo mailing list
> R-sig-Geo@r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>



-- 
*Manuel Spínola, Ph.D.*
Instituto Internacional en Conservación y Manejo de Vida Silvestre
Universidad Nacional
Apartado 1350-3000
Heredia
COSTA RICA
mspin...@una.cr <mspin...@una.ac.cr>
mspinol...@gmail.com
Teléfono: (506) 8706 - 4662
Personal website: Lobito de río <https://sites.google.com/site/lobitoderio/>
Institutional website: ICOMVIS <http://www.icomvis.una.ac.cr/>

[[alternative HTML version deleted]]

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

[R-sig-Geo] Estimation of utilization distribution and home range within a polygon

2016-08-15 Thread Manuel Spínola
Dear list members,

Is there a way to estimate utilization distribution and home range area
within a polygon.  I am working with spatial location on a fish in a
wetland but the utilization distribution and the home range cannot go
outside the water boundary.

I tried using a spatial polygon as spatial line and specify this in the
boundary argument of the kernelUD function of the adehabitatHR package but
I got an error:

> ud = kernelUD(dfs_in[,2], h="href", grid = 100, boundary = riol)

Error in .boundaryk(SpatialPoints(x, proj4string =
CRS(as.character(pfs1))),  :
  non convenient boundary: turning angles > pi/2

"riol" is the spatial polygon coerced to spatial line

Thank you very much in advance

Manuel

-- 
*Manuel Spínola, Ph.D.*
Instituto Internacional en Conservación y Manejo de Vida Silvestre
Universidad Nacional
Apartado 1350-3000
Heredia
COSTA RICA
mspin...@una.cr <mspin...@una.ac.cr>
mspinol...@gmail.com
Teléfono: (506) 8706 - 4662
Personal website: Lobito de río <https://sites.google.com/site/lobitoderio/>
Institutional website: ICOMVIS <http://www.icomvis.una.ac.cr/>

[[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] putting scalebar and north arrow on google map

2016-07-18 Thread Manuel Spínola
Or you can try the package ggsn with the package ggmap

Manuel

2016-07-17 22:57 GMT-06:00 Chris Lusk <cl...@waikato.ac.nz>:

> Hi - I've made a map to show the spatial arrangement of my plots, and would
> now like to add a scale bar (in hundreds of metres) and a north arrow. I've
> seen several solutions online, most of which threw error messages when I
> tried them. Although the solution below doesn't give an error message, it
> doesn't actually add anything to the map!
>
> Any advice would be appreciated.
>
> Chris
> ..
>
> library(ggplot2)
> library(ggmap)
> library(maps)
> library(GISTools)
>
> ##Coordinates of four types of plots
> Gaps <- read.table(text="lon lat
> 176.431823 -38.086894
> 176.4329002 -38.08855667
> 176.4286505 -38.08421246
> 176.4239767 -38.08297953
> 176.4306576 -38.09032491
> 176.4181457 -38.08283416
> 176.4325089 -38.09042394
> 176.4243027 -38.08215021
> 176.4220882 -38.08720573
> 176.430974-38.093108", header = TRUE, strip.white = TRUE)
>
> Understorey <- read.table(text="lon lat
> 176.431523   -38.086965
> 176.418408   -38.082935
> 176.4244189 -38.08242069
> 176.4287644 -38.08372266
> 176.4240118 -38.0823004
> 176.4333778 -38.08853369
> 176.4217424 -38.0876122
> 176.4309304 -38.09055117
> 176.4324084 -38.0907023
> 176.430821   -38.093687", header = TRUE, strip.white = TRUE)
>
> Treeferns <- read.table(text="lon lat
> 176.432134  -38.086298
> 176.4246547 -38.08226916
> 176.4335132 -38.08801622
> 176.4183628 -38.08260261
> 176.429   -38.08413018
> 176.4213997 -38.08710868
> 176.4304333 -38.09064678
> 176.4324081 -38.0909994
> 176.4242689 -38.08264669
> 176.429837  -38.093061", header = TRUE, strip.white = TRUE)
>
> Margins <- read.table(text="lon lat
> 176.4225302 -38.08177849
> 176.427018 -38.08879161
> 176.4207786 -38.08356826
> 176.4315118 -38.08251629
> 176.426456 -38.08920441
> 176.426010   -38.088253
> 176.422526   -38.082794
> 176.421399   -38.084780
> 176.429339   -38.092742", header = TRUE, strip.white = TRUE)
>
> ## Get the map at right zoom level
> OkatainaMap <- get_googlemap(center = c(lon = 176.425, lat = -38.0845),
> maptype='hybrid', zoom=15)
>
> ## Plot the points on the map
> ggmap(OkatainaMap) +
>   geom_point(data=Gaps, aes(x=lon, y=lat), pch=15, colour="chartreuse1",
> size=2.5, alpha=1) +
>   geom_point(data=Understorey, aes(x=lon, y=lat), pch=21, colour="gray40",
> bg="black", size=3, alpha=1) +
>   geom_point(data=Treeferns, aes(x=lon, y=lat), pch=23, colour="gray40",
> bg="blue", size=2.5, alpha=1) +
>   geom_point(data=Margins, aes(x=lon, y=lat), pch=17, colour="orange",
> size=2.5, alpha=1)
>
> ##Add scale and north arrow (NEITHER COMMAND WORKS FOR ME)
>
> map.scale(x=176.42,y=-38.092, ratio=FALSE, relwidth=0.2, col="white")
> north.arrow(xb=176.435, yb=-38.079, len=0.02, lab="N", col="white")
>
> ...
>
>
> Dr. Chris Lusk
> Senior Research Fellow
> Environmental Research Institute
> The University of Waikato
> Private Bag 3105, Hamilton
> New Zealand / Aotearoa
> http://sci.waikato.ac.nz/sites/clusk/
> Ph 64 7 838 4205
> Senior Editor, *NZ J Botany*
> ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~
>
> [[alternative HTML version deleted]]
>
> ___
> R-sig-Geo mailing list
> R-sig-Geo@r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>



-- 
*Manuel Spínola, Ph.D.*
Instituto Internacional en Conservación y Manejo de Vida Silvestre
Universidad Nacional
Apartado 1350-3000
Heredia
COSTA RICA
mspin...@una.cr <mspin...@una.ac.cr>
mspinol...@gmail.com
Teléfono: (506) 8706 - 4662
Personal website: Lobito de río <https://sites.google.com/site/lobitoderio/>
Institutional website: ICOMVIS <http://www.icomvis.una.ac.cr/>

[[alternative HTML version deleted]]

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

[R-sig-Geo] Values in a raster disappear when using reproject (plotKML, program = "GDAL")

2016-02-21 Thread Manuel Spínola
Dear list members,

When reprojecting a raster using the function "reproject" from plotKML
using program GDAL I lost the values from the raster layer (I used this
option to speed up the process in comparison to projectRaster from the
Raster package). Is there a way to keep the values from the raster? The
raster is categorical, each value correspond to land cover type.

> ras = raster("lc.tif")
> ras
class   : RasterLayer
dimensions  : 16118, 21959, 353935162  (nrow, ncol, ncell)
resolution  : 98.4252, 98.4252  (x, y)
extent  : 183871.7, 2345191, 88600.88, 1675018  (xmin, xmax, ymin, ymax)
coord. ref. : +proj=lcc +lat_1=43 +lat_2=45.5 +lat_0=41.75 +lon_0=-120.5
+x_0=39.99 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=ft
+no_defs
data source :
C:\Users\Manuel\Documents\Documentos_personales\Clases_y_Cursos\Clases\ICOMVIS\03_Evaluacion_del_Habitat\Practicos\Practica_03_Seleccion_de_habitat_Paisaje\oregon\lc.tif
names   : lc
values  : 0, 95  (min, max)
attributes  :
   ID category
 from:  060051
 to  : 95  2481857


>rasp = reproject(ras, CRS("+proj=longlat +datum=WGS84"), program = "GDAL",
method = "nearest")
>rasp
class   : RasterLayer
dimensions  : 12941, 24966, 323085006  (nrow, ncol, ncell)
resolution  : 0.00034231, 0.00034231  (x, y)
extent  : -124.9617, -116.4156, 41.91483, 46.34466  (xmin, xmax, ymin,
ymax)
coord. ref. : +proj=longlat +datum=WGS84 +no_defs +ellps=WGS84
+towgs84=0,0,0
data source :
C:\Users\Manuel\AppData\Local\Temp\Rtmpkh9ze0\file14a81d003f19_ll.tif
names   : lc



Manuel



-- 
*Manuel Spínola, Ph.D.*
Instituto Internacional en Conservación y Manejo de Vida Silvestre
Universidad Nacional
Apartado 1350-3000
Heredia
COSTA RICA
mspin...@una.ac.cr
mspinol...@gmail.com
Teléfono: (506) 2277-3598
Fax: (506) 2237-7036
Personal website: Lobito de río <https://sites.google.com/site/lobitoderio/>
Institutional website: ICOMVIS <http://www.icomvis.una.ac.cr/>

[[alternative HTML version deleted]]

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

  1   2   >