Subscribe to R-sig-geo feed
This is an archive for R-sig-geo, not a forum. It is not possible to post through Nabble - you may not start a new thread nor follow up an existing thread. If you wish to post, but are not subscribed to the list through the list homepage, subscribe first (through the list homepage, not via Nabble) and post from your subscribed email address. Until 2015-06-20, subscribers could post through Nabble, but policy has been changed as too many non-subscribers misunderstood the interface.
Updated: 1 hour 59 min ago

Re: Problem installing rgdal

Thu, 11/08/2018 - 03:11
Thanks Alex for the help!

I managed to solve the problem:

----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
I did:
• ubuntu-gis repository wasn't added correctly, but was added 5 times. I
removed everything ubuntu-gis related from `sources.list.d`
• I removed and purged `r-base`, `r-core`, `gdal-bin`, `libgdal-dev`, and
did autoremove aufterwards.
• rebooted
• added ubuntu-gis correctly (the way their webpage suggested), installed
`gdal-bin`, `libgdal-dev`, `R` + packages. No errors whatsoever.


On Wed, Nov 7, 2018 at 6:33 PM Alex M <[hidden email]> wrote:

> Jeremy,
>
> Please keep the thread on list so every-one can see the
> discussion/solution (reply-all).
>
> I don't have a 18.10 box to test on quickly. But can you review what
> steps you did, ie: what system packages did you install before
> attempting to install rgdal? Usually you need libgdal-dev libproj-dev
> and perhaps libsqlite3-dev libgeos-dev (all of these are supposed to be
> dependencies of libgdal-dev).
>
> Also it might be good to jump this over to the R-sig-debian list where
> many people are familiar with the OS
> https://stat.ethz.ch/mailman/listinfo/r-sig-debian (also covers ubuntu &
> mint, all debian derivatives). One option is usually the marutter ppa
> which has system packages for cran libraries, however it doesn't appear
> to support 18.10 yet
> http://sites.psu.edu/theubunturblog/installing-r-in-ubuntu/
>
> Thanks,
> Alex
>
>
> On 11/7/18 01:51, Jeremy Kraft wrote:
> > I'm on linux, ubuntu 18.10. I've been trying to reinstall  libgdal-dev
> but
> > that did not solve the problem.
> >
> > Thanks,
> >
> > On Tue, Nov 6, 2018 at 7:12 PM Alex M <[hidden email]>
> wrote:
> >
> >> On 11/6/18 09:31, Jeremy Kraft wrote:
> >>> Hello,
> >>>
> >>> I'm trying to reinstall rgdal, but I have a problem with the sqlite
> >>> dependency.
> >>> Below is the R output.
> >>>
> >>> Does someone knows how to solve the problem?
> >>>
> >>> Thanks,
> >>>
> >>> Jeremy
> >>>
> >>>
> >>
> -------------------------------------------------------------------------------------------------------------------------------
> >>> jeremy@yuri-HP-ProBook-640-G1:/$ R
> >>>
> >>> R version 3.4.4 (2018-03-15) -- "Someone to Lean On"
> >>> Copyright (C) 2018 The R Foundation for Statistical Computing
> >>> Platform: x86_64-pc-linux-gnu (64-bit)
> >>>
> >>> R is free software and comes with ABSOLUTELY NO WARRANTY.
> >>> You are welcome to redistribute it under certain conditions.
> >>> Type 'license()' or 'licence()' for distribution details.
> >>>
> >>>   Natural language support but running in an English locale
> >>>
> >>> R is a collaborative project with many contributors.
> >>> Type 'contributors()' for more information and
> >>> 'citation()' on how to cite R or R packages in publications.
> >>>
> >>> Type 'demo()' for some demos, 'help()' for on-line help, or
> >>> 'help.start()' for an HTML browser interface to help.
> >>> Type 'q()' to quit R.
> >>>
> >>>> install.packages('rgdal')
> >>> Installing package into
> ‘/home/jeremy/R/x86_64-pc-linux-gnu-library/3.4’
> >>> (as ‘lib’ is unspecified)
> >>> trying URL 'https://cloud.r-project.org/src/contrib/rgdal_1.3-6.tar.gz
> '
> >>> Content type 'application/x-gzip' length 1666975 bytes (1.6 MB)
> >>> ==================================================
> >>> downloaded 1.6 MB
> >>>
> >>> * installing *source* package ‘rgdal’ ...
> >>> ** package ‘rgdal’ successfully unpacked and MD5 sums checked
> >>> configure: R_HOME: /usr/lib/R
> >>> configure: CC: gcc -std=gnu99
> >>> configure: CXX: g++
> >>> configure: C++11 support available
> >>> configure: rgdal: 1.3-6
> >>> checking for /usr/bin/svnversion... no
> >>> configure: svn revision: 773
> >>> checking for gdal-config... /usr/bin/gdal-config
> >>> checking gdal-config usability... yes
> >>> configure: GDAL: 2.2.3
> >>> checking GDAL version >= 1.11.4... yes
> >>> checking gdal: linking with --libs only... no
> >>> checking gdal: linking with --libs and --dep-libs... no
> >>> /usr/bin/ld: /usr/lib/libgdal.a(genbindataset.o): relocation
> R_X86_64_32
> >>> against `.rodata.str1.8' can not be used when making a PIE object;
> >>> recompile with -fPIC
> >>> /usr/bin/ld: /usr/lib/libgdal.a(geotiff.o): relocation R_X86_64_32
> >> against
> >>> `.rodata.str1.1' can not be used when making a PIE object; recompile
> with
> >>> -fPIC
> >>> /usr/bin/ld: /usr/lib/libgdal.a(gff_dataset.o): relocation R_X86_64_32S
> >>> against hidden symbol `_ZTV10GFFDataset' can not be used when making a
> >> PIE
> >>> object
> >>>
> >>> *
> >>> * Long list
> >>> *
> >>> /usr/bin/ld: /usr/lib/libgdal.a(gmlhandler.o): relocation R_X86_64_32
> >>> against `.rodata.str1.1' can not be used when making a PIE object;
> >>> recompile with -fPIC
> >>> /usr/bin/ld: /usr/lib/libgdal.a(ili2handler.o): relocation R_X86_64_32S
> >>> against hidden symbol `_ZTV11ILI2Handler' can not be used when making a
> >> PIE
> >>> object
> >>> /usr/bin/ld: /usr/lib/libgdal.a(nashandler.o): relocation R_X86_64_32
> >>> against `.rodata.str1.8' can not be used when making a PIE object;
> >>> recompile with -fPIC
> >>> /usr/bin/ld: /usr/lib/libgdal.a(ntf_codelist.o): relocation R_X86_64_32
> >>> against `.rodata.str1.1' can not be used when making a PIE object;
> >>> recompile with -fPIC
> >>> /usr/bin/ld: /usr/lib/libgdal.a(ntf_estlayers.o): relocation
> R_X86_64_32S
> >>> against hidden symbol `_ZN11OGRNTFLayer12GetLayerDefnEv' can not be
> used
> >>> when making a PIE object
> >>> /usr/bin/ld: /usr/lib/libgdal.a(ntf_raster.o): relocation R_X86_64_32S
> >>> against hidden symbol `_ZTV17OGRNTFRasterLayer' can not be used when
> >> making
> >>> a PIE object
> >>> /usr/bin/ld: /usr/lib/libgdal.a(ogrmssqlgeometryparser.o): relocation
> >>> R_X86_64_32S against `.rodata' can not be used when making a PIE
> object;
> >>> recompile with -fPIC
> >>> /usr/bin/ld: final link failed: Nonrepresentable section on output
> >>> collect2: error: ld returned 1 exit status
> >>> /usr/bin/ld: /usr/lib/libgdal.a(ogrsqliteapiroutines.o): undefined
> >>> reference to symbol 'sqlite3_prepare'
> >>> /usr/lib/x86_64-linux-gnu/libsqlite3.so.0: error adding symbols: DSO
> >>> missing from command line
> >>> collect2: error: ld returned 1 exit status
> >>> configure: Install failure: compilation and/or linkage problems.
> >>> configure: error: GDALAllRegister not found in libgdal.
> >>> ERROR: configuration failed for package ‘rgdal’
> >>> * removing ‘/home/jeremy/R/x86_64-pc-linux-gnu-library/3.4/rgdal’
> >>>
> >>> The downloaded source packages are in
> >>>     ‘/tmp/RtmpKSJ85K/downloaded_packages’
> >>> Warning message:
> >>> In install.packages("rgdal") :
> >>>   installation of package ‘rgdal’ had non-zero exit status
> >>>
> >>>
> >>
> >> Looks like an issue with your system libgdal-dev package, perhaps
> >> reinstall the system dependencies. Which OS are you installing on?
> >>
> >> Thanks,
> >> Alex
> >>
> >>
> >
>
>
--
Jeremy Kraft
Data Scientist

Parkbob GmbH
[hidden email] <[hidden email]>
www.parkbob.com
FN 430551 p FB-Gericht: Handelsgericht Wien

The contents of this e-mail message and any attachments are confidential
and are intended solely for the addressee. This transmission is sent in
trust, for the sole purpose of delivery to the intended recipient. If you
have received this transmission in error, any use, reproduction or
dissemination of this transmission is strictly prohibited. If you are not
the intended recipient, please immediately *notify* the sender by reply
e-mail or phone and *delete* this message and its attachments, if any.

        [[alternative HTML version deleted]]

_______________________________________________
R-sig-Geo mailing list
[hidden email]
https://stat.ethz.ch/mailman/listinfo/r-sig-geo

Re: gdalUtils::gdal_translate()

Thu, 11/08/2018 - 03:04
Alex,
It was not a problem with the gdal installation, I had already checked:
> gdal_setInstallation()
> getOption("gdalUtils_gdalPath")[[1]]$path
[1] "/usr/bin/"
> getOption("gdalUtils_gdalPath")[[1]]$version
version
"2.3.2"
> getOption("gdalUtils_gdalPath")[[1]]$date
        date
"2018-09-21"

Also note that the rest of gdalUtilities do work.

But thanks to your spotting of the missing c(), the error message
vanishes out. So it was a problem of my mistake with the missing c()
+ a wrong error message that was totally misleading me.

Many thanks!

Agus

On Wed, Nov 7, 2018 at 7:18 PM Alex M <[hidden email]> wrote:
>
> gdal_translate does work fine for me on R 3.4
>
> That error sounds like your install is having issues picking what gdal
> installation to use.
> ?gdal_chooseInstallation
>
> perhaps your install was not found correctly amd you need to run
> gdal_setInstallation?
>
> But I also see something in your call that looks off to me.
>
> Based on the docs projwin takes a numeric vector. Which to me should
> look like projwin=c(ext@xmin,ext@ymax,ext@xmax,ext@ymin)
>
> Thanks,
> Alex
>
> On 11/7/18 01:02, Agustin Lobo wrote:
> > I find the following problem when trying gdal_translate():
> >>  gdal_translate(src_dataset=file.path(dirMAJAIma,"imain20.vrt"),
> > +             dst_dataset="test.tif",
> > +             ot="Int16",projwin=ext@xmin,ext@ymax,ext@xmax,ext@ymin)
> > Error in gdal_chooseInstallation(hasDrivers = of) :
> >   No installations match.
> >
> > Other functions in gdalUtils do work and gdal_translate works on the
> > Debian terminal.
> > Does igdal_translate() work for other people?
> > Thanks
> > Agus
> >
> > sessionInfo()
> > R version 3.5.0 (2018-04-23)
> > Platform: x86_64-pc-linux-gnu (64-bit)
> > Running under: Debian GNU/Linux buster/sid
> >
> > Matrix products: default
> > BLAS: /usr/lib/x86_64-linux-gnu/blas/libblas.so.3.8.0
> > LAPACK: /usr/lib/x86_64-linux-gnu/lapack/liblapack.so.3.8.0
> >
> > locale:
> >  [1] LC_CTYPE=en_GB.UTF-8       LC_NUMERIC=C
> > LC_TIME=en_GB.UTF-8
> >  [4] LC_COLLATE=en_GB.UTF-8     LC_MONETARY=en_GB.UTF-8
> > LC_MESSAGES=en_GB.UTF-8
> >  [7] LC_PAPER=en_GB.UTF-8       LC_NAME=C
> > LC_ADDRESS=C
> > [10] LC_TELEPHONE=C             LC_MEASUREMENT=en_GB.UTF-8
> > LC_IDENTIFICATION=C
> >
> > attached base packages:
> > [1] stats     graphics  grDevices utils     datasets  methods   base
> >
> > other attached packages:
> > [1] gdalUtils_2.0.1.14 rgdal_1.3-6        R.utils_2.7.0
> > R.oo_1.22.0        R.methodsS3_1.7.1
> > [6] raster_2.7-15      sp_1.3-1
> >
> > loaded via a namespace (and not attached):
> >  [1] compiler_3.5.0   tools_3.5.0      yaml_2.2.0       Rcpp_0.12.19
> >   codetools_0.2-15 grid_3.5.0
> >  [7] iterators_1.0.10 foreach_1.4.4    knitr_1.20       lattice_0.20-35
> >
> > _______________________________________________
> > R-sig-Geo mailing list
> > [hidden email]
> > https://stat.ethz.ch/mailman/listinfo/r-sig-geo
> >
>
> _______________________________________________
> R-sig-Geo mailing list
> [hidden email]
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
_______________________________________________
R-sig-Geo mailing list
[hidden email]
https://stat.ethz.ch/mailman/listinfo/r-sig-geo

Re: Varying measurement error in Kriging predictions

Thu, 11/08/2018 - 01:47
Please read p 74, "Kriging data with known measurement errors", of
http://gstat.org/gstat.pdf . It refers to a method published by Delhomme
(1978). The software was written long before the Christensen paper you
mention, to which I don't have access.


On 11/6/18 3:55 PM, Antonis Alexiadis wrote:
> Hello, my question is how can I implement known varying measurement error
> in my
> Kriging predictions?
>
> I have two separate datasets: the first one is a 2-D dataset that includes
> the observations and
> the second is the a 2-D dataset that includes the measurement error in each
> specific location.
> The measurement error dataset follows a structure, it's not random (which
> can be characterized via the use of the experimental variogram).
>
> I have searched a lot online on how to incorporate the measurement
> uncertainty in
> Kriging predictions but it seems to still be an open question in the forums
> (a paper solving this issue has been developed by William F. Christensen
> titled as: Filtered Kriging for Spatial Data with Heterogeneous Measurement
> Error Variances). I have tried to use gstat and incorporate the variances
> using the weights functionality but after I do the kriging and visualize
> the predicted variance field, even though it qualitatively resembles the
> defined one, the values of the variances are magnitudes lower than the ones
> proposed.
>
> Does anyone have an idea on how to solve it, or aware of some
> software-package that
> has already implemented this functionality? (It's quite tough to understand
> the stated paper already, rather having to program
> its contents) .
>
>
> Thank you.
>
> Regards,
> Antonios.
>
> [[alternative HTML version deleted]]
>
> _______________________________________________
> R-sig-Geo mailing list
> [hidden email]
> 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
[hidden email]
https://stat.ethz.ch/mailman/listinfo/r-sig-geo

pEpkey.asc (2K) Download Attachment

Re: gdalUtils::gdal_translate()

Wed, 11/07/2018 - 12:17
gdal_translate does work fine for me on R 3.4

That error sounds like your install is having issues picking what gdal
installation to use.
?gdal_chooseInstallation

perhaps your install was not found correctly amd you need to run
gdal_setInstallation?

But I also see something in your call that looks off to me.

Based on the docs projwin takes a numeric vector. Which to me should
look like projwin=c(ext@xmin,ext@ymax,ext@xmax,ext@ymin)

Thanks,
Alex

On 11/7/18 01:02, Agustin Lobo wrote:
> I find the following problem when trying gdal_translate():
>>  gdal_translate(src_dataset=file.path(dirMAJAIma,"imain20.vrt"),
> +             dst_dataset="test.tif",
> +             ot="Int16",projwin=ext@xmin,ext@ymax,ext@xmax,ext@ymin)
> Error in gdal_chooseInstallation(hasDrivers = of) :
>   No installations match.
>
> Other functions in gdalUtils do work and gdal_translate works on the
> Debian terminal.
> Does igdal_translate() work for other people?
> Thanks
> Agus
>
> sessionInfo()
> R version 3.5.0 (2018-04-23)
> Platform: x86_64-pc-linux-gnu (64-bit)
> Running under: Debian GNU/Linux buster/sid
>
> Matrix products: default
> BLAS: /usr/lib/x86_64-linux-gnu/blas/libblas.so.3.8.0
> LAPACK: /usr/lib/x86_64-linux-gnu/lapack/liblapack.so.3.8.0
>
> locale:
>  [1] LC_CTYPE=en_GB.UTF-8       LC_NUMERIC=C
> LC_TIME=en_GB.UTF-8
>  [4] LC_COLLATE=en_GB.UTF-8     LC_MONETARY=en_GB.UTF-8
> LC_MESSAGES=en_GB.UTF-8
>  [7] LC_PAPER=en_GB.UTF-8       LC_NAME=C
> LC_ADDRESS=C
> [10] LC_TELEPHONE=C             LC_MEASUREMENT=en_GB.UTF-8
> LC_IDENTIFICATION=C
>
> attached base packages:
> [1] stats     graphics  grDevices utils     datasets  methods   base
>
> other attached packages:
> [1] gdalUtils_2.0.1.14 rgdal_1.3-6        R.utils_2.7.0
> R.oo_1.22.0        R.methodsS3_1.7.1
> [6] raster_2.7-15      sp_1.3-1
>
> loaded via a namespace (and not attached):
>  [1] compiler_3.5.0   tools_3.5.0      yaml_2.2.0       Rcpp_0.12.19
>   codetools_0.2-15 grid_3.5.0
>  [7] iterators_1.0.10 foreach_1.4.4    knitr_1.20       lattice_0.20-35
>
> _______________________________________________
> R-sig-Geo mailing list
> [hidden email]
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>
_______________________________________________
R-sig-Geo mailing list
[hidden email]
https://stat.ethz.ch/mailman/listinfo/r-sig-geo

Re: Problem installing rgdal

Wed, 11/07/2018 - 11:33
Jeremy,

Please keep the thread on list so every-one can see the
discussion/solution (reply-all).

I don't have a 18.10 box to test on quickly. But can you review what
steps you did, ie: what system packages did you install before
attempting to install rgdal? Usually you need libgdal-dev libproj-dev
and perhaps libsqlite3-dev libgeos-dev (all of these are supposed to be
dependencies of libgdal-dev).

Also it might be good to jump this over to the R-sig-debian list where
many people are familiar with the OS
https://stat.ethz.ch/mailman/listinfo/r-sig-debian (also covers ubuntu &
mint, all debian derivatives). One option is usually the marutter ppa
which has system packages for cran libraries, however it doesn't appear
to support 18.10 yet
http://sites.psu.edu/theubunturblog/installing-r-in-ubuntu/

Thanks,
Alex


On 11/7/18 01:51, Jeremy Kraft wrote:
> I'm on linux, ubuntu 18.10. I've been trying to reinstall  libgdal-dev but
> that did not solve the problem.
>
> Thanks,
>
> On Tue, Nov 6, 2018 at 7:12 PM Alex M <[hidden email]> wrote:
>
>> On 11/6/18 09:31, Jeremy Kraft wrote:
>>> Hello,
>>>
>>> I'm trying to reinstall rgdal, but I have a problem with the sqlite
>>> dependency.
>>> Below is the R output.
>>>
>>> Does someone knows how to solve the problem?
>>>
>>> Thanks,
>>>
>>> Jeremy
>>>
>>>
>> -------------------------------------------------------------------------------------------------------------------------------
>>> jeremy@yuri-HP-ProBook-640-G1:/$ R
>>>
>>> R version 3.4.4 (2018-03-15) -- "Someone to Lean On"
>>> Copyright (C) 2018 The R Foundation for Statistical Computing
>>> Platform: x86_64-pc-linux-gnu (64-bit)
>>>
>>> R is free software and comes with ABSOLUTELY NO WARRANTY.
>>> You are welcome to redistribute it under certain conditions.
>>> Type 'license()' or 'licence()' for distribution details.
>>>
>>>   Natural language support but running in an English locale
>>>
>>> R is a collaborative project with many contributors.
>>> Type 'contributors()' for more information and
>>> 'citation()' on how to cite R or R packages in publications.
>>>
>>> Type 'demo()' for some demos, 'help()' for on-line help, or
>>> 'help.start()' for an HTML browser interface to help.
>>> Type 'q()' to quit R.
>>>
>>>> install.packages('rgdal')
>>> Installing package into ‘/home/jeremy/R/x86_64-pc-linux-gnu-library/3.4’
>>> (as ‘lib’ is unspecified)
>>> trying URL 'https://cloud.r-project.org/src/contrib/rgdal_1.3-6.tar.gz'
>>> Content type 'application/x-gzip' length 1666975 bytes (1.6 MB)
>>> ==================================================
>>> downloaded 1.6 MB
>>>
>>> * installing *source* package ‘rgdal’ ...
>>> ** package ‘rgdal’ successfully unpacked and MD5 sums checked
>>> configure: R_HOME: /usr/lib/R
>>> configure: CC: gcc -std=gnu99
>>> configure: CXX: g++
>>> configure: C++11 support available
>>> configure: rgdal: 1.3-6
>>> checking for /usr/bin/svnversion... no
>>> configure: svn revision: 773
>>> checking for gdal-config... /usr/bin/gdal-config
>>> checking gdal-config usability... yes
>>> configure: GDAL: 2.2.3
>>> checking GDAL version >= 1.11.4... yes
>>> checking gdal: linking with --libs only... no
>>> checking gdal: linking with --libs and --dep-libs... no
>>> /usr/bin/ld: /usr/lib/libgdal.a(genbindataset.o): relocation R_X86_64_32
>>> against `.rodata.str1.8' can not be used when making a PIE object;
>>> recompile with -fPIC
>>> /usr/bin/ld: /usr/lib/libgdal.a(geotiff.o): relocation R_X86_64_32
>> against
>>> `.rodata.str1.1' can not be used when making a PIE object; recompile with
>>> -fPIC
>>> /usr/bin/ld: /usr/lib/libgdal.a(gff_dataset.o): relocation R_X86_64_32S
>>> against hidden symbol `_ZTV10GFFDataset' can not be used when making a
>> PIE
>>> object
>>>
>>> *
>>> * Long list
>>> *
>>> /usr/bin/ld: /usr/lib/libgdal.a(gmlhandler.o): relocation R_X86_64_32
>>> against `.rodata.str1.1' can not be used when making a PIE object;
>>> recompile with -fPIC
>>> /usr/bin/ld: /usr/lib/libgdal.a(ili2handler.o): relocation R_X86_64_32S
>>> against hidden symbol `_ZTV11ILI2Handler' can not be used when making a
>> PIE
>>> object
>>> /usr/bin/ld: /usr/lib/libgdal.a(nashandler.o): relocation R_X86_64_32
>>> against `.rodata.str1.8' can not be used when making a PIE object;
>>> recompile with -fPIC
>>> /usr/bin/ld: /usr/lib/libgdal.a(ntf_codelist.o): relocation R_X86_64_32
>>> against `.rodata.str1.1' can not be used when making a PIE object;
>>> recompile with -fPIC
>>> /usr/bin/ld: /usr/lib/libgdal.a(ntf_estlayers.o): relocation R_X86_64_32S
>>> against hidden symbol `_ZN11OGRNTFLayer12GetLayerDefnEv' can not be used
>>> when making a PIE object
>>> /usr/bin/ld: /usr/lib/libgdal.a(ntf_raster.o): relocation R_X86_64_32S
>>> against hidden symbol `_ZTV17OGRNTFRasterLayer' can not be used when
>> making
>>> a PIE object
>>> /usr/bin/ld: /usr/lib/libgdal.a(ogrmssqlgeometryparser.o): relocation
>>> R_X86_64_32S against `.rodata' can not be used when making a PIE object;
>>> recompile with -fPIC
>>> /usr/bin/ld: final link failed: Nonrepresentable section on output
>>> collect2: error: ld returned 1 exit status
>>> /usr/bin/ld: /usr/lib/libgdal.a(ogrsqliteapiroutines.o): undefined
>>> reference to symbol 'sqlite3_prepare'
>>> /usr/lib/x86_64-linux-gnu/libsqlite3.so.0: error adding symbols: DSO
>>> missing from command line
>>> collect2: error: ld returned 1 exit status
>>> configure: Install failure: compilation and/or linkage problems.
>>> configure: error: GDALAllRegister not found in libgdal.
>>> ERROR: configuration failed for package ‘rgdal’
>>> * removing ‘/home/jeremy/R/x86_64-pc-linux-gnu-library/3.4/rgdal’
>>>
>>> The downloaded source packages are in
>>>     ‘/tmp/RtmpKSJ85K/downloaded_packages’
>>> Warning message:
>>> In install.packages("rgdal") :
>>>   installation of package ‘rgdal’ had non-zero exit status
>>>
>>>
>>
>> Looks like an issue with your system libgdal-dev package, perhaps
>> reinstall the system dependencies. Which OS are you installing on?
>>
>> Thanks,
>> Alex
>>
>>
>
_______________________________________________
R-sig-Geo mailing list
[hidden email]
https://stat.ethz.ch/mailman/listinfo/r-sig-geo

Re: Random forest script - problems with training areas polygon?

Wed, 11/07/2018 - 08:07
Silvia,
you say that the areas of the shapefile are smaller. Do they intersect
pixels centroids? The help of function 'extract' says the following (which
might be relevant for your case?):

If y represents polygons, the extract method returns the values of the
cells of a Raster* object that are covered by a polygon. A cell is covered
if its center is inside the polygon (but see the weights  option for
considering partly covered cells; and argument small for getting values for
small polygons anyway).

Cheers
Hugo

Roman Luštrik <[hidden email]> escreveu no dia quarta, 7/11/2018
à(s) 15:03:

> Can you make a reproducible example (data, scripts)? Have you tried
> debugging your code?
>
> Cheers,
> Roman
>
> On Wed, Nov 7, 2018 at 2:36 PM Silvia Flaherty <[hidden email]>
> wrote:
>
> > Hi all,
> >
> >
> >
> > I have been working with the random forest R script and have had no
> > problems at all up to now.
> >
> > I recently modified the training areas shapefile. It´s actually an edited
> > version of the original shapefile (which worked just fine). Same
> > projection, etc, only the areas are smaller and more specific. That's the
> > only input I changes. The script reads the shapefile but it doesn't do
> the
> > classification.
> >
> >
> >
> > The error  I get is:
> >
> >  Error in `[.data.frame`(satValues, , 2) : undefined columns selected
> >
> >
> >
> > Checking line by line, he problem seems to be (line 139 of the loop):
> >
> > satValues <- extract(satImage, class_data[i,], cellnumbers=TRUE, df=TRUE)
> >
> >
> >
> >
> >
> > I´m not very skilled at using R but I´m quite OK with GIS. I have tried
> > editing the shapefile again, saving it as another file, etc. Same result.
> >
> >
> >
> > Any ideas what could be going wrong?
> >
> > Thanks!
> >
> >
> >
> > Silvia
> >
> >
> > <
> >
> https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail
> > >
> > Libre
> > de virus. www.avast.com
> > <
> >
> https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail
> > >
> > <#m_542342069031620777_DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>
> >
> >         [[alternative HTML version deleted]]
> >
> > _______________________________________________
> > R-sig-Geo mailing list
> > [hidden email]
> > https://stat.ethz.ch/mailman/listinfo/r-sig-geo
> >
>
>
> --
> In God we trust, all others bring data.
>
>         [[alternative HTML version deleted]]
>
> _______________________________________________
> R-sig-Geo mailing list
> [hidden email]
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>
        [[alternative HTML version deleted]]

_______________________________________________
R-sig-Geo mailing list
[hidden email]
https://stat.ethz.ch/mailman/listinfo/r-sig-geo

Re: Random forest script - problems with training areas polygon?

Wed, 11/07/2018 - 08:03
Can you make a reproducible example (data, scripts)? Have you tried
debugging your code?

Cheers,
Roman

On Wed, Nov 7, 2018 at 2:36 PM Silvia Flaherty <[hidden email]>
wrote:

> Hi all,
>
>
>
> I have been working with the random forest R script and have had no
> problems at all up to now.
>
> I recently modified the training areas shapefile. It´s actually an edited
> version of the original shapefile (which worked just fine). Same
> projection, etc, only the areas are smaller and more specific. That's the
> only input I changes. The script reads the shapefile but it doesn't do the
> classification.
>
>
>
> The error  I get is:
>
>  Error in `[.data.frame`(satValues, , 2) : undefined columns selected
>
>
>
> Checking line by line, he problem seems to be (line 139 of the loop):
>
> satValues <- extract(satImage, class_data[i,], cellnumbers=TRUE, df=TRUE)
>
>
>
>
>
> I´m not very skilled at using R but I´m quite OK with GIS. I have tried
> editing the shapefile again, saving it as another file, etc. Same result.
>
>
>
> Any ideas what could be going wrong?
>
> Thanks!
>
>
>
> Silvia
>
>
> <
> https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail
> >
> Libre
> de virus. www.avast.com
> <
> https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail
> >
> <#m_542342069031620777_DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>
>
>         [[alternative HTML version deleted]]
>
> _______________________________________________
> R-sig-Geo mailing list
> [hidden email]
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>

--
In God we trust, all others bring data.

        [[alternative HTML version deleted]]

_______________________________________________
R-sig-Geo mailing list
[hidden email]
https://stat.ethz.ch/mailman/listinfo/r-sig-geo

Random forest script - problems with training areas polygon?

Wed, 11/07/2018 - 07:35
Hi all,



I have been working with the random forest R script and have had no
problems at all up to now.

I recently modified the training areas shapefile. It´s actually an edited
version of the original shapefile (which worked just fine). Same
projection, etc, only the areas are smaller and more specific. That's the
only input I changes. The script reads the shapefile but it doesn't do the
classification.



The error  I get is:

 Error in `[.data.frame`(satValues, , 2) : undefined columns selected



Checking line by line, he problem seems to be (line 139 of the loop):

satValues <- extract(satImage, class_data[i,], cellnumbers=TRUE, df=TRUE)





I´m not very skilled at using R but I´m quite OK with GIS. I have tried
editing the shapefile again, saving it as another file, etc. Same result.



Any ideas what could be going wrong?

Thanks!



Silvia


<https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail>
Libre
de virus. www.avast.com
<https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail>
<#m_542342069031620777_DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>

        [[alternative HTML version deleted]]

_______________________________________________
R-sig-Geo mailing list
[hidden email]
https://stat.ethz.ch/mailman/listinfo/r-sig-geo

gdalUtils::gdal_translate()

Wed, 11/07/2018 - 03:02
I find the following problem when trying gdal_translate():
>  gdal_translate(src_dataset=file.path(dirMAJAIma,"imain20.vrt"),
+             dst_dataset="test.tif",
+             ot="Int16",projwin=ext@xmin,ext@ymax,ext@xmax,ext@ymin)
Error in gdal_chooseInstallation(hasDrivers = of) :
  No installations match.

Other functions in gdalUtils do work and gdal_translate works on the
Debian terminal.
Does igdal_translate() work for other people?
Thanks
Agus

sessionInfo()
R version 3.5.0 (2018-04-23)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Debian GNU/Linux buster/sid

Matrix products: default
BLAS: /usr/lib/x86_64-linux-gnu/blas/libblas.so.3.8.0
LAPACK: /usr/lib/x86_64-linux-gnu/lapack/liblapack.so.3.8.0

locale:
 [1] LC_CTYPE=en_GB.UTF-8       LC_NUMERIC=C
LC_TIME=en_GB.UTF-8
 [4] LC_COLLATE=en_GB.UTF-8     LC_MONETARY=en_GB.UTF-8
LC_MESSAGES=en_GB.UTF-8
 [7] LC_PAPER=en_GB.UTF-8       LC_NAME=C
LC_ADDRESS=C
[10] LC_TELEPHONE=C             LC_MEASUREMENT=en_GB.UTF-8
LC_IDENTIFICATION=C

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base

other attached packages:
[1] gdalUtils_2.0.1.14 rgdal_1.3-6        R.utils_2.7.0
R.oo_1.22.0        R.methodsS3_1.7.1
[6] raster_2.7-15      sp_1.3-1

loaded via a namespace (and not attached):
 [1] compiler_3.5.0   tools_3.5.0      yaml_2.2.0       Rcpp_0.12.19
  codetools_0.2-15 grid_3.5.0
 [7] iterators_1.0.10 foreach_1.4.4    knitr_1.20       lattice_0.20-35

_______________________________________________
R-sig-Geo mailing list
[hidden email]
https://stat.ethz.ch/mailman/listinfo/r-sig-geo

Re: Problem installing rgdal

Tue, 11/06/2018 - 12:12
On 11/6/18 09:31, Jeremy Kraft wrote:
> Hello,
>
> I'm trying to reinstall rgdal, but I have a problem with the sqlite
> dependency.
> Below is the R output.
>
> Does someone knows how to solve the problem?
>
> Thanks,
>
> Jeremy
>
> -------------------------------------------------------------------------------------------------------------------------------
> jeremy@yuri-HP-ProBook-640-G1:/$ R
>
> R version 3.4.4 (2018-03-15) -- "Someone to Lean On"
> Copyright (C) 2018 The R Foundation for Statistical Computing
> Platform: x86_64-pc-linux-gnu (64-bit)
>
> R is free software and comes with ABSOLUTELY NO WARRANTY.
> You are welcome to redistribute it under certain conditions.
> Type 'license()' or 'licence()' for distribution details.
>
>   Natural language support but running in an English locale
>
> R is a collaborative project with many contributors.
> Type 'contributors()' for more information and
> 'citation()' on how to cite R or R packages in publications.
>
> Type 'demo()' for some demos, 'help()' for on-line help, or
> 'help.start()' for an HTML browser interface to help.
> Type 'q()' to quit R.
>
>> install.packages('rgdal')
> Installing package into ‘/home/jeremy/R/x86_64-pc-linux-gnu-library/3.4’
> (as ‘lib’ is unspecified)
> trying URL 'https://cloud.r-project.org/src/contrib/rgdal_1.3-6.tar.gz'
> Content type 'application/x-gzip' length 1666975 bytes (1.6 MB)
> ==================================================
> downloaded 1.6 MB
>
> * installing *source* package ‘rgdal’ ...
> ** package ‘rgdal’ successfully unpacked and MD5 sums checked
> configure: R_HOME: /usr/lib/R
> configure: CC: gcc -std=gnu99
> configure: CXX: g++
> configure: C++11 support available
> configure: rgdal: 1.3-6
> checking for /usr/bin/svnversion... no
> configure: svn revision: 773
> checking for gdal-config... /usr/bin/gdal-config
> checking gdal-config usability... yes
> configure: GDAL: 2.2.3
> checking GDAL version >= 1.11.4... yes
> checking gdal: linking with --libs only... no
> checking gdal: linking with --libs and --dep-libs... no
> /usr/bin/ld: /usr/lib/libgdal.a(genbindataset.o): relocation R_X86_64_32
> against `.rodata.str1.8' can not be used when making a PIE object;
> recompile with -fPIC
> /usr/bin/ld: /usr/lib/libgdal.a(geotiff.o): relocation R_X86_64_32 against
> `.rodata.str1.1' can not be used when making a PIE object; recompile with
> -fPIC
> /usr/bin/ld: /usr/lib/libgdal.a(gff_dataset.o): relocation R_X86_64_32S
> against hidden symbol `_ZTV10GFFDataset' can not be used when making a PIE
> object
>
> *
> * Long list
> *
> /usr/bin/ld: /usr/lib/libgdal.a(gmlhandler.o): relocation R_X86_64_32
> against `.rodata.str1.1' can not be used when making a PIE object;
> recompile with -fPIC
> /usr/bin/ld: /usr/lib/libgdal.a(ili2handler.o): relocation R_X86_64_32S
> against hidden symbol `_ZTV11ILI2Handler' can not be used when making a PIE
> object
> /usr/bin/ld: /usr/lib/libgdal.a(nashandler.o): relocation R_X86_64_32
> against `.rodata.str1.8' can not be used when making a PIE object;
> recompile with -fPIC
> /usr/bin/ld: /usr/lib/libgdal.a(ntf_codelist.o): relocation R_X86_64_32
> against `.rodata.str1.1' can not be used when making a PIE object;
> recompile with -fPIC
> /usr/bin/ld: /usr/lib/libgdal.a(ntf_estlayers.o): relocation R_X86_64_32S
> against hidden symbol `_ZN11OGRNTFLayer12GetLayerDefnEv' can not be used
> when making a PIE object
> /usr/bin/ld: /usr/lib/libgdal.a(ntf_raster.o): relocation R_X86_64_32S
> against hidden symbol `_ZTV17OGRNTFRasterLayer' can not be used when making
> a PIE object
> /usr/bin/ld: /usr/lib/libgdal.a(ogrmssqlgeometryparser.o): relocation
> R_X86_64_32S against `.rodata' can not be used when making a PIE object;
> recompile with -fPIC
> /usr/bin/ld: final link failed: Nonrepresentable section on output
> collect2: error: ld returned 1 exit status
> /usr/bin/ld: /usr/lib/libgdal.a(ogrsqliteapiroutines.o): undefined
> reference to symbol 'sqlite3_prepare'
> /usr/lib/x86_64-linux-gnu/libsqlite3.so.0: error adding symbols: DSO
> missing from command line
> collect2: error: ld returned 1 exit status
> configure: Install failure: compilation and/or linkage problems.
> configure: error: GDALAllRegister not found in libgdal.
> ERROR: configuration failed for package ‘rgdal’
> * removing ‘/home/jeremy/R/x86_64-pc-linux-gnu-library/3.4/rgdal’
>
> The downloaded source packages are in
>     ‘/tmp/RtmpKSJ85K/downloaded_packages’
> Warning message:
> In install.packages("rgdal") :
>   installation of package ‘rgdal’ had non-zero exit status
>
>
Looks like an issue with your system libgdal-dev package, perhaps
reinstall the system dependencies. Which OS are you installing on?

Thanks,
Alex

_______________________________________________
R-sig-Geo mailing list
[hidden email]
https://stat.ethz.ch/mailman/listinfo/r-sig-geo

Problem installing rgdal

Tue, 11/06/2018 - 11:31
Hello,

I'm trying to reinstall rgdal, but I have a problem with the sqlite
dependency.
Below is the R output.

Does someone knows how to solve the problem?

Thanks,

Jeremy

-------------------------------------------------------------------------------------------------------------------------------
jeremy@yuri-HP-ProBook-640-G1:/$ R

R version 3.4.4 (2018-03-15) -- "Someone to Lean On"
Copyright (C) 2018 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

  Natural language support but running in an English locale

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> install.packages('rgdal')
Installing package into ‘/home/jeremy/R/x86_64-pc-linux-gnu-library/3.4’
(as ‘lib’ is unspecified)
trying URL 'https://cloud.r-project.org/src/contrib/rgdal_1.3-6.tar.gz'
Content type 'application/x-gzip' length 1666975 bytes (1.6 MB)
==================================================
downloaded 1.6 MB

* installing *source* package ‘rgdal’ ...
** package ‘rgdal’ successfully unpacked and MD5 sums checked
configure: R_HOME: /usr/lib/R
configure: CC: gcc -std=gnu99
configure: CXX: g++
configure: C++11 support available
configure: rgdal: 1.3-6
checking for /usr/bin/svnversion... no
configure: svn revision: 773
checking for gdal-config... /usr/bin/gdal-config
checking gdal-config usability... yes
configure: GDAL: 2.2.3
checking GDAL version >= 1.11.4... yes
checking gdal: linking with --libs only... no
checking gdal: linking with --libs and --dep-libs... no
/usr/bin/ld: /usr/lib/libgdal.a(genbindataset.o): relocation R_X86_64_32
against `.rodata.str1.8' can not be used when making a PIE object;
recompile with -fPIC
/usr/bin/ld: /usr/lib/libgdal.a(geotiff.o): relocation R_X86_64_32 against
`.rodata.str1.1' can not be used when making a PIE object; recompile with
-fPIC
/usr/bin/ld: /usr/lib/libgdal.a(gff_dataset.o): relocation R_X86_64_32S
against hidden symbol `_ZTV10GFFDataset' can not be used when making a PIE
object

*
* Long list
*
/usr/bin/ld: /usr/lib/libgdal.a(gmlhandler.o): relocation R_X86_64_32
against `.rodata.str1.1' can not be used when making a PIE object;
recompile with -fPIC
/usr/bin/ld: /usr/lib/libgdal.a(ili2handler.o): relocation R_X86_64_32S
against hidden symbol `_ZTV11ILI2Handler' can not be used when making a PIE
object
/usr/bin/ld: /usr/lib/libgdal.a(nashandler.o): relocation R_X86_64_32
against `.rodata.str1.8' can not be used when making a PIE object;
recompile with -fPIC
/usr/bin/ld: /usr/lib/libgdal.a(ntf_codelist.o): relocation R_X86_64_32
against `.rodata.str1.1' can not be used when making a PIE object;
recompile with -fPIC
/usr/bin/ld: /usr/lib/libgdal.a(ntf_estlayers.o): relocation R_X86_64_32S
against hidden symbol `_ZN11OGRNTFLayer12GetLayerDefnEv' can not be used
when making a PIE object
/usr/bin/ld: /usr/lib/libgdal.a(ntf_raster.o): relocation R_X86_64_32S
against hidden symbol `_ZTV17OGRNTFRasterLayer' can not be used when making
a PIE object
/usr/bin/ld: /usr/lib/libgdal.a(ogrmssqlgeometryparser.o): relocation
R_X86_64_32S against `.rodata' can not be used when making a PIE object;
recompile with -fPIC
/usr/bin/ld: final link failed: Nonrepresentable section on output
collect2: error: ld returned 1 exit status
/usr/bin/ld: /usr/lib/libgdal.a(ogrsqliteapiroutines.o): undefined
reference to symbol 'sqlite3_prepare'
/usr/lib/x86_64-linux-gnu/libsqlite3.so.0: error adding symbols: DSO
missing from command line
collect2: error: ld returned 1 exit status
configure: Install failure: compilation and/or linkage problems.
configure: error: GDALAllRegister not found in libgdal.
ERROR: configuration failed for package ‘rgdal’
* removing ‘/home/jeremy/R/x86_64-pc-linux-gnu-library/3.4/rgdal’

The downloaded source packages are in
    ‘/tmp/RtmpKSJ85K/downloaded_packages’
Warning message:
In install.packages("rgdal") :
  installation of package ‘rgdal’ had non-zero exit status

        [[alternative HTML version deleted]]

_______________________________________________
R-sig-Geo mailing list
[hidden email]
https://stat.ethz.ch/mailman/listinfo/r-sig-geo

Varying measurement error in Kriging predictions

Tue, 11/06/2018 - 08:55
Hello, my question is how can I implement known varying measurement error
in my
Kriging predictions?

I have two separate datasets: the first one is a 2-D dataset that includes
the observations and
the second is the a 2-D dataset that includes the measurement error in each
specific location.
The measurement error dataset follows a structure, it's not random (which
can be characterized via the use of the experimental variogram).

I have searched a lot online on how to incorporate the measurement
uncertainty in
Kriging predictions but it seems to still be an open question in the forums
(a paper solving this issue has been developed by William F. Christensen
titled as: Filtered Kriging for Spatial Data with Heterogeneous Measurement
Error Variances). I have tried to use gstat and incorporate the variances
using the weights functionality but after I do the kriging and visualize
the predicted variance field, even though it qualitatively resembles the
defined one, the values of the variances are magnitudes lower than the ones
proposed.

Does anyone have an idea on how to solve it, or aware of some
software-package that
has already implemented this functionality? (It's quite tough to understand
the stated paper already, rather having to program
its contents) .


Thank you.

Regards,
Antonios.

        [[alternative HTML version deleted]]

_______________________________________________
R-sig-Geo mailing list
[hidden email]
https://stat.ethz.ch/mailman/listinfo/r-sig-geo

Re: R-sig-Geo Digest, Vol 182, Issue 13

Tue, 11/06/2018 - 07:22
I am doing NDVI time series analysis using MODIS data.I have produced my
map for NDVI trends.I produced five classes of the trends.
1.How do I calculate percentage areas for each category and the areas
represented by each category?
2.How do I determine area represented by my study area?

On Tue, Oct 30, 2018 at 1:02 PM <[hidden email]> wrote:

> Send R-sig-Geo mailing list submissions to
>         [hidden email]
>
> To subscribe or unsubscribe via the World Wide Web, visit
>         https://stat.ethz.ch/mailman/listinfo/r-sig-geo
> or, via email, send a message with subject or body 'help' to
>         [hidden email]
>
> You can reach the person managing the list at
>         [hidden email]
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of R-sig-Geo digest..."
>
>
> Today's Topics:
>
>    1. Cost distance in spatial weight matrix (Roozbeh Valavi)
>    2. Re: Cost distance in spatial weight matrix
>       (=?UTF-8?Q?Facundo_Mu=c3=b1oz?=)
>
> ----------------------------------------------------------------------
>
> Message: 1
> Date: Mon, 29 Oct 2018 23:42:06 +1100
> From: Roozbeh Valavi <[hidden email]>
> To: [hidden email]
> Subject: [R-sig-Geo] Cost distance in spatial weight matrix
> Message-ID:
>         <
> [hidden email]>
> Content-Type: text/plain; charset="utf-8"
>
> Dear list,
>
> I wonder if it is possible to add some kind of cost/weighting when creating
> a spatial weight matrix to be used in a spatial lag model? I want to
> consider the effect of elevation as a cost for calculating distance to the
> neighbours.
> I am using spdep for creating the W and splm for the model.
>
> Thank you in advance,
> Roozbeh
> --
> *Roozbeh Valavi*
> PhD Candidate
> The Quantitative & Applied Ecology Group <http://qaeco.com/>
> School of BioSciences | Faculty of Science
> The University of Melbourne, VIC 3010, Australia
> Mobile: +61 423 283 238
>
>         [[alternative HTML version deleted]]
>
>
>
>
> ------------------------------
>
> Message: 2
> Date: Mon, 29 Oct 2018 14:48:43 +0100
> From: =?UTF-8?Q?Facundo_Mu=c3=b1oz?= <[hidden email]>
> To: [hidden email]
> Subject: Re: [R-sig-Geo] Cost distance in spatial weight matrix
> Message-ID: <[hidden email]>
> Content-Type: text/plain; charset="utf-8"
>
> Dear Roozbeh,
>
> package geoRcb [1]* provides function distmatGen() [2], which computes a
> cost-based distance matrix between any two sets of locations, given a
> raster cost surface (such as elevation). The function uses package
> gdistance to actually perform the computations, and it does not depend
> on anything else in the package, so you can simply copy it to your code
> base.
>
> Is that what you were looking for?
>
> ƒacu.-
>
>
>
> [1] https://github.com/famuvie/geoRcb/
>
> [2] https://github.com/famuvie/geoRcb/blob/master/R/distmatGen.R
>
> * Disclaimer: I'm the author.
>
>
> On 10/29/18 1:42 PM, Roozbeh Valavi wrote:
> > Dear list,
> >
> > I wonder if it is possible to add some kind of cost/weighting when
> creating
> > a spatial weight matrix to be used in a spatial lag model? I want to
> > consider the effect of elevation as a cost for calculating distance to
> the
> > neighbours.
> > I am using spdep for creating the W and splm for the model.
> >
> > Thank you in advance,
> > Roozbeh
>
>         [[alternative HTML version deleted]]
>
>
>
>
> ------------------------------
>
> Subject: Digest Footer
>
> _______________________________________________
> R-sig-Geo mailing list
> [hidden email]
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>
>
> ------------------------------
>
> End of R-sig-Geo Digest, Vol 182, Issue 13
> ******************************************
        [[alternative HTML version deleted]]

_______________________________________________
R-sig-Geo mailing list
[hidden email]
https://stat.ethz.ch/mailman/listinfo/r-sig-geo

Match European cities to Coordinates/NUTS 2

Mon, 11/05/2018 - 15:25
I have a dataframe (more than 50,000 observations), where one of the
variables is the city that unit is location. The units are all in Europe.

My goal is to assign NUTS-2 code to each of these cities. However, I am not
aware of any direct way of achieving this, so I wanted to first assign
coordinates to the cities and then use the 'over' function to match with
NUTS regions from EU shapefile.

I have tried to use 'geocode' from the ggmap package but there is a 2,500
per day limit. Is there any other solution? Any help will be greatly
appreciated.

Sincerely,

Milu

        [[alternative HTML version deleted]]

_______________________________________________
R-sig-Geo mailing list
[hidden email]
https://stat.ethz.ch/mailman/listinfo/r-sig-geo

Re: Raster to rasterbrick does not preserve Date/Time

Mon, 11/05/2018 - 14:59
Thank you, Ben! This works well.

Sincerely,

Milu

On Sun, Nov 4, 2018 at 11:08 PM Ben Tupper <[hidden email]> wrote:

> Hi,
>
> I'm not sure about reading the datetime stamp directly form the file, but
> you have enough info to convert the z-value which is well described in your
> ncdf.  I'm not familiar with the '%.f' format specifier, but it looks like
> it is a fractional day.  Something like this perhaps will work?
>
> z      <- raster::getZ(rbick)
> z0     <- floor(z)
> zf     <- z - z0
> dt     <- as.POSIXct(as.character(z0), format = "%Y%m%d") + 24*60*60*zf
> rbrick <- raster::setZ(rbrick, z, name = 'datetime')
>
> You'll need to think through the timezone issues that might arise.
> as.POSIXct() has arguments that can help you with that.
>
> Cheers,
> Ben
>
>
> > On Nov 4, 2018, at 12:39 PM, Miluji Sb <[hidden email]> wrote:
> >
> > Dear all,
> >
> > I have a raster with multiple variables and date/time information;
> >
> >      time  Size:17164   *** is unlimited ***
> >            standard_name: time
> >            bounds: time_bnds
> >            units: day as %Y%m%d.%f
> >            calendar: proleptic_gregorian
> >        bnds  Size:2
> >
> > My goal is to convert the raster file to rasterbrick for extraction
> > purposes;
> >
> > rbrick <- brick(r,  values=TRUE, varname="var1")
> >
> > However, after conversion - the date/time information is not preserved.
> How
> > can I preserve this information?
> >
> > class       : RasterBrick
> > dimensions  : 600, 1440, 864000, 17164  (nrow, ncol, ncell, nlayers)
> > resolution  : 0.25, 0.25  (x, y)
> > extent      : -180, 180, -60, 90  (xmin, xmax, ymin, ymax)
> > coord. ref. : +proj=longlat +datum=WGS84 +ellps=WGS84 +towgs84=0,0,0
> > data source : /work/ncfile.nc4
> > names       : X19700101.4375, X19700102.4375, X19700103.4375,
> > X19700104.4375, X19700105.4375, X19700106.4375, X19700107.4375,
> > X19700108.4375, X19700109.4375, X19700110.4375, X19700111.4375,
> > X19700112.4375, X19700113.4375, X19700114.4375, X19700115.4375, ...
> > z-value     : 19700101.4375, 20161231.4375 (min, max)
> > varname     : var1
> >
> > Any help will be greatly appreciated!
> >
> > Sincerely,
> >
> > Milu
> >
> >       [[alternative HTML version deleted]]
> >
> > _______________________________________________
> > R-sig-Geo mailing list
> > [hidden email]
> > https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>
> Ben Tupper
> Bigelow Laboratory for Ocean Sciences
> 60 Bigelow Drive, P.O. Box 380
> East Boothbay, Maine 04544
> http://www.bigelow.org
>
> Ecological Forecasting: https://eco.bigelow.org/
>
>
>
>
>
>
        [[alternative HTML version deleted]]

_______________________________________________
R-sig-Geo mailing list
[hidden email]
https://stat.ethz.ch/mailman/listinfo/r-sig-geo

Re: Reordering geographical coordinates clockwise to make a polygon

Mon, 11/05/2018 - 13:41
alphahull or a hand-crafted "triangulate and cull long/large triangles"
might be workable options (geometry and RTriangle have the fastest and most
useful triangulation functions).

It's not generally a tractable problem afaics.  Some refs that came up in
recent discussions:

https://pdfs.semanticscholar.org/669b/1415cd64d39f1e44fd90c2b9d9453c42581b.pdf

http://erikdemaine.org/polygonization/

Cheers, Mike.

On Tue, 6 Nov 2018 at 05:26 Edzer Pebesma <[hidden email]>
wrote:

> Sorry for my previous answer, I didn't get the question fully.
>
> I'm afraid I still don't get the question fully, but functions that
> might help are sf::st_line_merge (creates a LINESTRING from line pieces)
> and sf::st_polygonize (creates a polygon from a LINESTRING that forms a
> closed ring)
>
> On 11/5/18 5:35 PM, Patrick Giraudoux wrote:
> >
> > Apologize to answer to myself: the way described below would work only
> > if there are no concave "peninsula" towards north or south inside the
> > polygon. Even thinking about an alternate solution, e.g. the Traveling
> > Salesman Problem (TSP), ie. the shortest route linking all points, one
> > could get wrong since points of  a narrowpeninsula could have points
> > closest to the opposite border than from the next point on the border...
> >
> > Suppose we are stuck, and should redraw polygons by hand
> >
> >
> > Le 05/11/2018 à 14:02, Patrick Giraudoux a écrit :
> >>
> >> Dear listers,
> >>
> >> There is an interesting post here:
> >>
> https://stackoverflow.com/questions/6989100/sort-points-in-clockwise-order
> >> dealing on the issue. However, I would like to know if a function has
> >> been already developped in a R package.
> >>
> >> I am coping with a young colleague's shapefile where borders of
> >> polygons have been drawn as lines quite inconsistently. To change this
> >> SpatialLinesDataFrame into a SpatialPoints object is easy. The idea is
> >> to  select the points  bordering each polygon (delete the others),
> >> define the point set as a Polygon, then rebuild step by step a
> >> SpatialPolygonsDataFrame with all its (~25) polygons. It would be much
> >> quicker than to redraw one by one the 5160 data points (two times on
> >> borders shared by two polygons).
> >>
> >> The problem is that the points must be reordered clockwise (the way
> >> lines making the  borders is all except clockwise) before making them
> >> a polygon.
> >>
> >> Any function already developped for that ?
> >>
> >> Cheers,
> >>
> >> Patrick
> >>
> >>
> >>
> >
> >
> >       [[alternative HTML version deleted]]
> >
> > _______________________________________________
> > R-sig-Geo mailing list
> > [hidden email]
> > https://stat.ethz.ch/mailman/listinfo/r-sig-geo
> >
>
> --
> Edzer Pebesma
> Institute for Geoinformatics
> Heisenbergstrasse 2, 48151 Muenster, Germany
> Phone: +49 251 8333081 <+49%20251%208333081>
> _______________________________________________
> R-sig-Geo mailing list
> [hidden email]
> 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

        [[alternative HTML version deleted]]

_______________________________________________
R-sig-Geo mailing list
[hidden email]
https://stat.ethz.ch/mailman/listinfo/r-sig-geo

Re: Reordering geographical coordinates clockwise to make a polygon

Mon, 11/05/2018 - 12:25
Sorry for my previous answer, I didn't get the question fully.

I'm afraid I still don't get the question fully, but functions that
might help are sf::st_line_merge (creates a LINESTRING from line pieces)
and sf::st_polygonize (creates a polygon from a LINESTRING that forms a
closed ring)

On 11/5/18 5:35 PM, Patrick Giraudoux wrote:
>
> Apologize to answer to myself: the way described below would work only
> if there are no concave "peninsula" towards north or south inside the
> polygon. Even thinking about an alternate solution, e.g. the Traveling
> Salesman Problem (TSP), ie. the shortest route linking all points, one
> could get wrong since points of  a narrowpeninsula could have points
> closest to the opposite border than from the next point on the border...
>
> Suppose we are stuck, and should redraw polygons by hand
>
>
> Le 05/11/2018 à 14:02, Patrick Giraudoux a écrit :
>>
>> Dear listers,
>>
>> There is an interesting post here:
>> https://stackoverflow.com/questions/6989100/sort-points-in-clockwise-order 
>> dealing on the issue. However, I would like to know if a function has
>> been already developped in a R package.
>>
>> I am coping with a young colleague's shapefile where borders of
>> polygons have been drawn as lines quite inconsistently. To change this
>> SpatialLinesDataFrame into a SpatialPoints object is easy. The idea is
>> to  select the points  bordering each polygon (delete the others),
>> define the point set as a Polygon, then rebuild step by step a
>> SpatialPolygonsDataFrame with all its (~25) polygons. It would be much
>> quicker than to redraw one by one the 5160 data points (two times on
>> borders shared by two polygons).
>>
>> The problem is that the points must be reordered clockwise (the way
>> lines making the  borders is all except clockwise) before making them
>> a polygon.
>>
>> Any function already developped for that ?
>>
>> Cheers,
>>
>> Patrick
>>
>>
>>
>
>
> [[alternative HTML version deleted]]
>
> _______________________________________________
> R-sig-Geo mailing list
> [hidden email]
> 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
[hidden email]
https://stat.ethz.ch/mailman/listinfo/r-sig-geo

pEpkey.asc (2K) Download Attachment

Re: Reordering geographical coordinates clockwise to make a polygon

Mon, 11/05/2018 - 10:35

Apologize to answer to myself: the way described below would work only
if there are no concave "peninsula" towards north or south inside the
polygon. Even thinking about an alternate solution, e.g. the Traveling
Salesman Problem (TSP), ie. the shortest route linking all points, one
could get wrong since points of  a narrowpeninsula could have points
closest to the opposite border than from the next point on the border...

Suppose we are stuck, and should redraw polygons by hand


Le 05/11/2018 à 14:02, Patrick Giraudoux a écrit :
>
> Dear listers,
>
> There is an interesting post here:
> https://stackoverflow.com/questions/6989100/sort-points-in-clockwise-order 
> dealing on the issue. However, I would like to know if a function has
> been already developped in a R package.
>
> I am coping with a young colleague's shapefile where borders of
> polygons have been drawn as lines quite inconsistently. To change this
> SpatialLinesDataFrame into a SpatialPoints object is easy. The idea is
> to  select the points  bordering each polygon (delete the others),
> define the point set as a Polygon, then rebuild step by step a
> SpatialPolygonsDataFrame with all its (~25) polygons. It would be much
> quicker than to redraw one by one the 5160 data points (two times on
> borders shared by two polygons).
>
> The problem is that the points must be reordered clockwise (the way
> lines making the  borders is all except clockwise) before making them
> a polygon.
>
> Any function already developped for that ?
>
> Cheers,
>
> Patrick
>
>
>

        [[alternative HTML version deleted]]

_______________________________________________
R-sig-Geo mailing list
[hidden email]
https://stat.ethz.ch/mailman/listinfo/r-sig-geo

Re: Reordering geographical coordinates clockwise to make a polygon

Mon, 11/05/2018 - 09:31
Look for argument check_ring_dir in the documentation of sf::st_read.

On 11/5/18 2:02 PM, Patrick Giraudoux wrote:
> Dear listers,
>
> There is an interesting post here:
> https://stackoverflow.com/questions/6989100/sort-points-in-clockwise-order 
> dealing on the issue. However, I would like to know if a function has
> been already developped in a R package.
>
> I am coping with a young colleague's shapefile where borders of polygons
> have been drawn as lines quite inconsistently. To change this
> SpatialLinesDataFrame into a SpatialPoints object is easy. The idea is
> to  select the points  bordering each polygon (delete the others),
> define the point set as a Polygon, then rebuild step by step a
> SpatialPolygonsDataFrame with all its (~25) polygons. It would be much
> quicker than to redraw one by one the 5160 data points (two times on
> borders shared by two polygons).
>
> The problem is that the points must be reordered clockwise (the way
> lines making the  borders is all except clockwise) before making them a
> polygon.
>
> Any function already developped for that ?
>
> Cheers,
>
> Patrick
>
>
>
>
> [[alternative HTML version deleted]]
>
> _______________________________________________
> R-sig-Geo mailing list
> [hidden email]
> 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
[hidden email]
https://stat.ethz.ch/mailman/listinfo/r-sig-geo

pEpkey.asc (2K) Download Attachment

Reordering geographical coordinates clockwise to make a polygon

Mon, 11/05/2018 - 07:02
Dear listers,

There is an interesting post here:
https://stackoverflow.com/questions/6989100/sort-points-in-clockwise-order 
dealing on the issue. However, I would like to know if a function has
been already developped in a R package.

I am coping with a young colleague's shapefile where borders of polygons
have been drawn as lines quite inconsistently. To change this
SpatialLinesDataFrame into a SpatialPoints object is easy. The idea is
to  select the points  bordering each polygon (delete the others),
define the point set as a Polygon, then rebuild step by step a
SpatialPolygonsDataFrame with all its (~25) polygons. It would be much
quicker than to redraw one by one the 5160 data points (two times on
borders shared by two polygons).

The problem is that the points must be reordered clockwise (the way
lines making the  borders is all except clockwise) before making them a
polygon.

Any function already developped for that ?

Cheers,

Patrick




        [[alternative HTML version deleted]]

_______________________________________________
R-sig-Geo mailing list
[hidden email]
https://stat.ethz.ch/mailman/listinfo/r-sig-geo

Pages