Re: [R-sig-Geo] install rgdal from source macOS

2019-06-20 Thread Dominik Schneider
I finally got back to this. Unfortunately this did not work.
It still doesn't like PKG_CONFIG_PATH and now pcs.csv was not readable. It
did not exist in 'share/gdal' but I found it in miniconda3/pkgs/libgdal* so
I copied it to share/gdal.

> Sys.getenv('PKG_CONFIG_PATH')
[1] "/Users/dosc3612/Applications/miniconda3/envs/rgdal/lib/pkgconfig"
> grep('proj.pc',dir(Sys.getenv('PKG_CONFIG_PATH')))

I'm not sure why it can't find the pkg config

>  install.packages('rgdal', repo = 'https://r-forge.r-project.org', type =
"source",
configure.args=c('--with-proj-include=/Users/dosc3612/Applications/miniconda3/envs/rgdal/include',
'--with-proj-lib=/Users/dosc3612/Applications/miniconda3/envs/rgdal/lib',
'--with-gdal-config=/Users/dosc3612/Applications/miniconda3/envs/rgdal/bin/gdal-config','--with-proj-share=/Users/dosc3612/Applications/miniconda3/envs/rgdal/share/proj',
'--with-data-copy=yes'))
trying URL 'https://r-forge.r-project.org/src/contrib/rgdal_1.4-5.tar.gz'
Content type 'application/x-gzip' length 1687877 bytes (1.6 MB)
==
downloaded 1.6 MB

* installing *source* package ‘rgdal’ ...
** using staged installation
configure: R_HOME: /Library/Frameworks/R.framework/Resources
configure: CC: clang
configure: CXX: clang++ -std=gnu++11
configure: C++11 support available
configure: rgdal: 1.4-4
checking for /usr/bin/svnversion... yes
cat: inst/SVN_VERSION: No such file or directory
configure: svn revision:
configure: gdal-config set to
/Users/dosc3612/Applications/miniconda3/envs/rgdal/bin/gdal-config
checking gdal-config exists... yes
checking gdal-config executable... yes
checking gdal-config usability... yes
configure: GDAL: 3.0.0
checking GDAL version >= 1.11.4... yes
checking GDAL version <= 2.5 or >= 3.0... yes
checking gdal: linking with --libs only... yes
checking GDAL: gdal-config data directory readable... yes
checking GDAL:
/Users/dosc3612/Applications/miniconda3/envs/rgdal/share/gdal/pcs.csv
readable... yes
./configure: line 2101: pkg-config: command not found
configure: pkg-config proj not available
  set PKG_CONFIG_PATH to the directory containing proj.pc
configure: PROJ version not determined using pkg-config proj
configure: proj CPP flags:
 -I/Users/dosc3612/Applications/miniconda3/envs/rgdal/include
-I/Users/dosc3612/Applications/miniconda3/envs/rgdal/include
checking PROJ header API:... proj_api.h
checking proj_api.h presence and usability... yes
checking PROJ version >= 4.8.0... yes
configure: PROJ_LIB:
/Users/dosc3612/Applications/miniconda3/envs/rgdal/share/proj
dyld: Library not loaded: @rpath/libproj.15.dylib
  Referenced from:
/private/var/folders/bb/13z2kq0j01jg5q_0ypjc76grgn/T/RtmpVtyBCi/R.INSTALL76ca8b2ce2d/rgdal/./proj_conf_test2
  Reason: image not found
./configure: line 2451: 30994 Abort trap: 6
PROJ_LIB="${proj_share_path}" ./proj_conf_test2
checking PROJ: proj.db found and readable... yes
configure: Copy data for:
configure:   PROJ.4:
/Users/dosc3612/Applications/miniconda3/envs/rgdal/share/proj
configure:   GDAL:
/Users/dosc3612/Applications/miniconda3/envs/rgdal/share/gdal
configure: Package CPP flags:
 -I/Users/dosc3612/Applications/miniconda3/envs/rgdal/include
-I/Users/dosc3612/Applications/miniconda3/envs/rgdal/include
-DACCEPT_USE_OF_DEPRECATED_PROJ_API_H
configure: Package LIBS:
 -L/Users/dosc3612/Applications/miniconda3/envs/rgdal/lib -lgdal
-L/Users/dosc3612/Applications/miniconda3/envs/rgdal/lib -lproj
configure: creating ./config.status
config.status: creating src/Makevars
** libs
clang++ -std=gnu++11 -I"/Library/Frameworks/R.framework/Resources/include"
-DNDEBUG -I/Users/dosc3612/Applications/miniconda3/envs/rgdal/include
-I/Users/dosc3612/Applications/miniconda3/envs/rgdal/include
-DACCEPT_USE_OF_DEPRECATED_PROJ_API_H
-I"/Library/Frameworks/R.framework/Versions/3.6/Resources/library/sp/include"
-isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk
-I/usr/local/include  -fPIC  -Wall -g -O2  -c OGR_write.cpp -o OGR_write.o
clang++ -std=gnu++11 -I"/Library/Frameworks/R.framework/Resources/include"
-DNDEBUG -I/Users/dosc3612/Applications/miniconda3/envs/rgdal/include
-I/Users/dosc3612/Applications/miniconda3/envs/rgdal/include
-DACCEPT_USE_OF_DEPRECATED_PROJ_API_H
-I"/Library/Frameworks/R.framework/Versions/3.6/Resources/library/sp/include"
-isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk
-I/usr/local/include  -fPIC  -Wall -g -O2  -c gdal-bindings.cpp -o
gdal-bindings.o
clang -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG
-I/Users/dosc3612/Applications/miniconda3/envs/rgdal/include
-I/Users/dosc3612/Applications/miniconda3/envs/rgdal/include
-DACCEPT_USE_OF_DEPRECATED_PROJ_API_H
-I"/Library/Frameworks/R.framework/Versions/3.6/Resources/library/sp/include"
-isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk
-I/usr/local/include  -fPIC  -Wall -g -O2  -c init.c -o init.o
clang -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG

Re: [R-sig-Geo] [FORGED] Create a Spatial Weight Matrix based on road distance

2019-06-20 Thread Adrian Baddeley
Rather than converting an object of class 'SpatialLines' or 
'SpatialLinesDataFrame' to the spatstat class 'psp' and then converting it to 
the spatstat class 'linnet', it is safer and more efficient to convert the 
SpatialLines* object directly to class linnet using 
as.linnet.SpatialLinesDataFrame() from the package 'maptools'.


Prof Adrian Baddeley DSc FAA

John Curtin Distinguished Professor

Department of Mathematics and Statistics

Curtin University, Perth, Western Australia



From: Rolf Turner 
Sent: Friday, 21 June 2019 10:08 AM
To: Rolando Valdez
Cc: r-sig-geo@r-project.org; Adrian Baddeley; Ege Rubak
Subject: Re: [FORGED] [R-sig-Geo] Create a Spatial Weight Matrix based on road 
distance


On 21/06/19 12:26 PM, Rolando Valdez wrote:

> Dear community,
>
> Is there any way to create a spatial weight matrix based on road distance?
> I am trying to use the road distance between two points instead of
> euclidean distance.
>
> I've seen that there is a package named osrm. Can anyone give some advice?

I don't know anything about "osrm".  Calculating "road distances" can be
done in the spatstat package reasonably easily, if you take the trouble
to represent your collection of roads as a "linnet" object.

Given that you have done so, suppose that your linnet object is "L" and
that you have vectors "x" and "y" specifying the points on L (i.e. on
your roads) between which you want to know the distances.

Do:

 X<- lpp(data.frame(x=x,y=y),L)
 dMat <- pairdist(X)

The object "dMat" is a (symmetric) square matrix; dMat[i,j] is the
distance between point i and point j.  (Of course the diagonal entries
are all 0.)

If your collection of roads is specified by means of a shapefile,
vignette("shapefiles") will tell you how to turn this collection into a
"psp" ("planar segment pattern") object; the function (method)
as.linnet.psp() can then be used to turn the "psp" object into a
"linnet" object.

HTH

cheers,

Rolf Turner

--
Honorary Research Fellow
Department of Statistics
University of Auckland
Phone: +64-9-373-7599 ext. 88276

[[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] Create a Spatial Weight Matrix based on road distance

2019-06-20 Thread Rolf Turner



On 21/06/19 12:26 PM, Rolando Valdez wrote:


Dear community,

Is there any way to create a spatial weight matrix based on road distance?
I am trying to use the road distance between two points instead of
euclidean distance.

I've seen that there is a package named osrm. Can anyone give some advice?


I don't know anything about "osrm".  Calculating "road distances" can be 
done in the spatstat package reasonably easily, if you take the trouble 
to represent your collection of roads as a "linnet" object.


Given that you have done so, suppose that your linnet object is "L" and 
that you have vectors "x" and "y" specifying the points on L (i.e. on 
your roads) between which you want to know the distances.


Do:

X<- lpp(data.frame(x=x,y=y),L)
dMat <- pairdist(X)

The object "dMat" is a (symmetric) square matrix; dMat[i,j] is the 
distance between point i and point j.  (Of course the diagonal entries 
are all 0.)


If your collection of roads is specified by means of a shapefile, 
vignette("shapefiles") will tell you how to turn this collection into a 
"psp" ("planar segment pattern") object; the function (method) 
as.linnet.psp() can then be used to turn the "psp" object into a 
"linnet" object.


HTH

cheers,

Rolf Turner

--
Honorary Research Fellow
Department of Statistics
University of Auckland
Phone: +64-9-373-7599 ext. 88276

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


[R-sig-Geo] Create a Spatial Weight Matrix based on road distance

2019-06-20 Thread Rolando Valdez
Dear community,

Is there any way to create a spatial weight matrix based on road distance?
I am trying to use the road distance between two points instead of
euclidean distance.

I've seen that there is a package named osrm. Can anyone give some advice?

Thank you in advance.

Regards,

-- 
Rol~

[[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] Surface Chlorophyll data calculation

2019-06-20 Thread JC Arronte
Hello,

This is my first post to this list. I am a beginner in R and GIS and  I work as 
researcher at Spanish Institute of Oceanography.

I have a ncdf file from the Copernicus webpage with monthly primary production 
data from the Northeastern Atlantic. In my case, the chlorophyll concentration 
from the following link,

 
http://marine.copernicus.eu/services-portfolio/access-to-products/?option=com_csw=details_id=IBI_REANALYSIS_BIO_005_003

I want to calculate the monthly surface chlorophyll concentration. 
Unfortunately, after a lot of reading on the issue, I have been unable to come 
to any understanding.

Any indication of tutorials, scripts, sites or packages will be very welcomed.

Thanks in advance. Kindest regards,

Juan Carlos


[[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] testing a crs string

2019-06-20 Thread Roy Mendelssohn - NOAA Federal via R-sig-Geo
perfect.  Thank you.   I thought there must be a function in one of the 
packages to check.

-Roy

> On Jun 20, 2019, at 7:42 AM, Edzer Pebesma  
> wrote:
> 
> 
> 
> On 6/20/19 4:18 PM, Roy Mendelssohn - NOAA Federal via R-sig-Geo wrote:
>> Hi All:
>> 
>> I am extending a package I have to allow users to provide a crs string, 
>> which will eventually through some other packages be sent to sf.  I like to 
>> try and make at least minimal tests that inputs are valid.  Is there some 
>> existing code that will check if a string is a valid crs string?
> 
>> inherits(try(sf::st_crs("+proj=invalid"), silent = TRUE), "try-error")
> [1] TRUE
>> inherits(try(sf::st_crs("+proj=longlat"), silent = TRUE), "try-error")
> [1] FALSE
> 
> 
>> 
>> Thanks,
>> 
>> -Roy
>> 
>> 
>> **
>> "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: http://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
>> 
> 
> -- 
> 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

**
"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: http://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


Re: [R-sig-Geo] testing a crs string

2019-06-20 Thread Edzer Pebesma


On 6/20/19 4:18 PM, Roy Mendelssohn - NOAA Federal via R-sig-Geo wrote:
> Hi All:
> 
> I am extending a package I have to allow users to provide a crs string, which 
> will eventually through some other packages be sent to sf.  I like to try and 
> make at least minimal tests that inputs are valid.  Is there some existing 
> code that will check if a string is a valid crs string?

> inherits(try(sf::st_crs("+proj=invalid"), silent = TRUE), "try-error")
[1] TRUE
> inherits(try(sf::st_crs("+proj=longlat"), silent = TRUE), "try-error")
[1] FALSE


> 
> Thanks,
> 
> -Roy
> 
> 
> **
> "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: http://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
> 

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


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


[R-sig-Geo] testing a crs string

2019-06-20 Thread Roy Mendelssohn - NOAA Federal via R-sig-Geo
Hi All:

I am extending a package I have to allow users to provide a crs string, which 
will eventually through some other packages be sent to sf.  I like to try and 
make at least minimal tests that inputs are valid.  Is there some existing code 
that will check if a string is a valid crs string?

Thanks,

-Roy


**
"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: http://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