[R-sig-Geo] edge/boundary delineation in R?

Seth J Myers sjmyers at syr.edu
Tue Jun 22 23:20:31 CEST 2010



________________________________________
From: Seth J Myers
Sent: Saturday, June 19, 2010 3:01 PM
To: r-sig-geo at stat.math.ethz.ch
Subject: edge/boundary delineation in R?

Hi,

Sorry if you see this twice.  I submitted this a few days ago but have not seen it on the listserv.

I need to delineate edges in a multivariate data set with each variable measured at a systematic grid of points separated by a distance (not a contiguous lattice, i.e. raster).  Triangulation wombling appears to be the method most mentioned for this.  I cannot find an open source with this function.  SAM used to have it but now it appears it was removed.  R has wombsoft, which is designed specifically for allele frequency and so I'm afraid it won't work for several continuous variables.  Any suggestions for edge delineation with multiple variables in R (doesn't have to be wombling)?

Thanks
Seth

________________________________________
From: r-sig-geo-bounces at stat.math.ethz.ch [r-sig-geo-bounces at stat.math.ethz.ch] on behalf of r-sig-geo-request at stat.math.ethz.ch [r-sig-geo-request at stat.math.ethz.ch]
Sent: Saturday, June 19, 2010 6:00 AM
To: r-sig-geo at stat.math.ethz.ch
Subject: R-sig-Geo Digest, Vol 82, Issue 19

Send R-sig-Geo mailing list submissions to
        r-sig-geo at stat.math.ethz.ch

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
        r-sig-geo-request at stat.math.ethz.ch

You can reach the person managing the list at
        r-sig-geo-owner at stat.math.ethz.ch

When replying, please edit your Subject line so it is more specific
than "Re: Contents of R-sig-Geo digest..."


Today's Topics:

   1. Fw : image() with levels (Lho Lho)
   2. Re: Fw : image() with levels (Roger Bivand)
   3. Re: rgdal (tom sgouros)
   4. Re: rgdal (Roger Bivand)


----------------------------------------------------------------------

Message: 1
Date: Fri, 18 Jun 2010 10:02:11 +0000 (GMT)
From: Lho Lho <manguefleur at yahoo.fr>
To: r-sig-geo at stat.math.ethz.ch
Subject: [R-sig-Geo] Fw : image() with levels
Message-ID: <61398.11475.qm at web29214.mail.ird.yahoo.com>
Content-Type: text/plain; charset="iso-8859-1"






> Objet: image() with levels
> ?: "helpgeoR helpgeoR" <r-sig-geo at stat.math.ethz.ch>
> Date: Vendredi 18 juin 2010, 9h30
> Dear all
>
> I am beginner in R and I am involved in geostatistics
> analysis
>
> I failed to map my "values" with contour.filled() or
> image() [and add levels afterward with contour()] because I
> do not know how I should shape my data in order to use
> image() or contour.filled()
>
> I attached my data file for someone who can help me by
> providing me the code
>
> Best regards,
>
> lho
>
>
> ? ? ?



-------------- next part --------------
A non-text attachment was scrubbed...
Name: Myfile
Type: application/octet-stream
Size: 61350 bytes
Desc: not available
URL: <https://stat.ethz.ch/pipermail/r-sig-geo/attachments/20100618/a0686ec2/attachment-0001.obj>

------------------------------

Message: 2
Date: Fri, 18 Jun 2010 12:28:27 +0200 (CEST)
From: Roger Bivand <Roger.Bivand at nhh.no>

Cc: r-sig-geo at stat.math.ethz.ch
Subject: Re: [R-sig-Geo] Fw : image() with levels
Message-ID: <alpine.LRH.2.00.1006181217180.18137 at reclus.nhh.no>
Content-Type: text/plain; charset="iso-8859-15"; Format="flowed"

On Fri, 18 Jun 2010, Lho Lho wrote:

You are very impatient, and have forwarded your message (with a large and
unnecessary attachment) to the list as a repeat thread. This smells like
homework. Please read the posting guide:

http://www.r-project.org/posting-guide.html

and respect other users' time (and server capacity and net bandwidth)

Questions should be well-framed, but yours are incomprehensible - it is
impossible to know what your problem is (the subject is also very
unclear). Please examine carefully a sample of other threads and the
posting guide to see how to ask questions that may attract answers.

In general, attachments are not welcome. If an attachment seems
essential, please only provide a link to the files considered for
attachment, and do not attach the files themselves. Sending attachments to
over 1600 list members uses energy on multiple servers without any need,
and wastes server capacity. Only members prepared to reply are likely to
need to access the attachment, so a link is much more practical, even if
it takes a little longer to set up.

Your list admin,

Roger

>
>

>

>> Objet: image() with levels
>> ?: "helpgeoR helpgeoR" <r-sig-geo at stat.math.ethz.ch>
>> Date: Vendredi 18 juin 2010, 9h30
>> Dear all
>>
>> I am beginner in R and I am involved in geostatistics
>> analysis
>>
>> I failed to map my "values" with contour.filled() or
>> image() [and add levels afterward with contour()] because I
>> do not know how I should shape my data in order to use
>> image() or contour.filled()
>>
>> I attached my data file for someone who can help me by
>> providing me the code
>>
>> Best regards,
>>
>> lho
>>
>>
>> ? ? ?

--
Roger Bivand
Economic Geography Section, Department of Economics, Norwegian School of
Economics and Business Administration, Helleveien 30, N-5045 Bergen,
Norway. voice: +47 55 95 93 55; fax +47 55 95 95 43
e-mail: Roger.Bivand at nhh.no

------------------------------

Message: 3
Date: Fri, 18 Jun 2010 09:20:02 -0400
From: tom sgouros <tomfool at as220.org>
To: Roger.Bivand at nhh.no
Cc: r-sig-geo at stat.math.ethz.ch
Subject: Re: [R-sig-Geo] rgdal
Message-ID: <28149.1276867202 at as220.org>


Roger:

Thank you for the answers.  But I still don't understand why the default
installation wouldn't work before I tried to specify the location
explicitly?  /usr/local/lib doesn't seem non-standard to me, and it was
the default from the PROJ 'make install'.  Why wouldn't the default
rgdal installation work with the default PROJ installation?

Also, how would you suggest testing the PROJ installation?  Or GDAL, for
that matter.  Neither makefile seems to have a test target, and I'm
coming to them as dependencies of a different package that I want to
use, so they are not libraries with which I am familiar.  Where can I
find a test program?

Thank you,

 -tom


Roger Bivand <Roger.Bivand at nhh.no> wrote:

> On Thu, 17 Jun 2010, tom sgouros wrote:
>
> Your syntax for the configure.args= argument was wrong, and most
> likely it would fail on GDAL next. If you want to install from source,
> install PROJ.4 first, test it (you need the headers and the *shared*
> library), then install and test GDAL. When they are in place,
> determine the correct locations and use configure.args= without any
> PROJ=.
>
> If this sounds hard, use the Kyngchaos route, which is well tried,
> both for getting the external dependencies and installing rgdal from
> source, or indeed for installing binary rgdal (William Kyngesburye is
> kind enough to keep things pretty updated).
>
> The easiest route is to do:
>
> setRepositories(ind=1:2)
> install.packages("rgdal")
>
> which looking at the list archives would have shown, for example
> google on:
>
> R-sig-geo rgdal MAC
>
> or similar. The second repository in the list is in this case on OSX
> at Oxford on CRAN extras, and the rgdal binary with bundled PROJ.4 and
> GDAL dependencies is built by Brian Ripley:
>
> http://www.stats.ox.ac.uk/pub/RWin/bin/macosx/leopard/contrib/2.11/rgdal_0.6-27.tgz
>
> or similar for the R 2.10 and development 2.12 releases.
>
> Unless you need extra drivers, installing from CRAN extras version is
> probably the easiest.
>
> Roger
>
> >
> > Alex Mandel <tech_dev at wildintellect.com> wrote:
> >
> >> On 06/17/2010 05:40 PM, tom sgouros wrote:
> >>>
> >>> Hello all:
> >>>
> >>> I read this in the rgdal documentation:
> >>>
> >>>> The GDAL and PROJ.4 libraries are external to the package, and, when
> >>>> installing the package from source, must be correctly installed first.
> >>>
> >>> Does "correctly" mean something different from the default?  I installed
> >>> PROJ.4 on my Mac OS X (10.6) machine, using 'make all' and 'make
> >>> install'.  I saw no errors, and I see libproj.a sitting happily in
> >>> /usr/local/lib which seems pretty standard to me, but when I try to
> >>> install rgdal, I get this:
> >>>
> >>>   ...
> >>>   checking proj_api.h usability... yes
> >>>   checking proj_api.h presence... yes
> >>>   checking for proj_api.h... yes
> >>>   checking for pj_init_plus in -lproj... no
> >>>   Error: libproj.a not found.
> >>>   If the PROJ.4 library is installed in a non-standard location,
> >>>   use --configure-args='--with-proj-lib=/opt/local/lib' for example,
> >>>   replacing /opt/local/* with appropriate values for your installation.
> >>>   If PROJ.4 is not installed, install it.
> >>>
> >>> Before it was installed, the configure choked on the line about
> >>> proj_api.h.
> >>>
> >>> It was already installed, but per those directions, I tried this:
> >>>
> >>>> install.packages(c("rgdal"),lib="/Library/Frameworks/R.framework/Resources/library",contriburl=contrib.url(getOption("repos"),'source'),type='source',dependencies=TRUE,configure.args=c(PROJ='--with-proj-lib=/usr/local/lib'))
> >>>
> >> Those instructions seem to indicate that it should be:
> >> configure.args='--with-proj-lib=/usr/local/lib'
> >> while the R code you put in may seem similar and theoretically provide
> >> the same, try doing it exactly like the example.
> >
> > The example is from a command line invocation of ./configure.  How that
> > relates to an install.packages() option wasn't obvious to me.  I was
> > just copying the example in the install.packages() documentation.  But I
> > tried it your way just now and it still doesn't work.  Same error.
> > Besides, what's so non-standard about /usr/local/lib?
> >
> >>
> >> The other option to consider is install Proj and GDAL from the Frameworks:
> >> http://www.kyngchaos.com/software/frameworks
> >>
> >> I know people have gotten the frameworks to work.
> >
> > I'll try that, but I'm still mystified.
> >
> > Thank you,
> >
> > -tom
> >
> >
> >>
> >> Enjoy,
> >> Alex
> >>
> >> _______________________________________________
> >> R-sig-Geo mailing list
> >> R-sig-Geo at stat.math.ethz.ch
> >> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
> >>
> >
> >
> >
>
> --
> Roger Bivand
> Economic Geography Section, Department of Economics, Norwegian School of
> Economics and Business Administration, Helleveien 30, N-5045 Bergen,
> Norway. voice: +47 55 95 93 55; fax +47 55 95 95 43
> e-mail: Roger.Bivand at nhh.no
>







--
 --------------------------------------------------------
 Check out "Ten Things You Don't Know About Rhode Island"
     http://whatcheer.net      http://sgouros.com



------------------------------

Message: 4
Date: Fri, 18 Jun 2010 16:38:19 +0200 (CEST)
From: Roger Bivand <Roger.Bivand at nhh.no>
To: tom sgouros <tomfool at as220.org>
Cc: r-sig-geo at stat.math.ethz.ch
Subject: Re: [R-sig-Geo] rgdal
Message-ID: <alpine.LRH.2.00.1006181534170.18137 at reclus.nhh.no>
Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed

On Fri, 18 Jun 2010, tom sgouros wrote:

>
> Roger:
>
> Thank you for the answers.  But I still don't understand why the default
> installation wouldn't work before I tried to specify the location
> explicitly?  /usr/local/lib doesn't seem non-standard to me, and it was
> the default from the PROJ 'make install'.  Why wouldn't the default
> rgdal installation work with the default PROJ installation?

I believe that your syntax in the install.packages() command was wrong,
you had:

configure.args=c(PROJ='--with-proj-lib=/usr/local/lib')

which I don't think is what is needed, I think that the name PROJ= is
redundant, but c(rgdal='--with-proj-lib=/usr/local/lib') would seem to
correspond to the documentation, because this is a configure argument to
rgdal. In the example, two R packages are being installed, each with a
configure argument.

>
> Also, how would you suggest testing the PROJ installation?

make check in proj-4.7.0 for that release.

> Or GDAL, for that matter.

It is a separate download - look for gdalautotest for the major release
family.

> Neither makefile seems to have a test target, and I'm coming to them as
> dependencies of a different package that I want to use, so they are not
> libraries with which I am familiar.  Where can I find a test program?

Usually it is sufficient to run ogrinfo on any vector file, and gdalinfo
on any raster file (both for simple drivers). This shows that the
dynamically loaded dependencies are satisfied. Running the gdalautotest is
more for developers.

Hope this helps,

Roger

>
> Thank you,
>
> -tom
>
>
> Roger Bivand <Roger.Bivand at nhh.no> wrote:
>
>> On Thu, 17 Jun 2010, tom sgouros wrote:
>>
>> Your syntax for the configure.args= argument was wrong, and most
>> likely it would fail on GDAL next. If you want to install from source,
>> install PROJ.4 first, test it (you need the headers and the *shared*
>> library), then install and test GDAL. When they are in place,
>> determine the correct locations and use configure.args= without any
>> PROJ=.
>>
>> If this sounds hard, use the Kyngchaos route, which is well tried,
>> both for getting the external dependencies and installing rgdal from
>> source, or indeed for installing binary rgdal (William Kyngesburye is
>> kind enough to keep things pretty updated).
>>
>> The easiest route is to do:
>>
>> setRepositories(ind=1:2)
>> install.packages("rgdal")
>>
>> which looking at the list archives would have shown, for example
>> google on:
>>
>> R-sig-geo rgdal MAC
>>
>> or similar. The second repository in the list is in this case on OSX
>> at Oxford on CRAN extras, and the rgdal binary with bundled PROJ.4 and
>> GDAL dependencies is built by Brian Ripley:
>>
>> http://www.stats.ox.ac.uk/pub/RWin/bin/macosx/leopard/contrib/2.11/rgdal_0.6-27.tgz
>>
>> or similar for the R 2.10 and development 2.12 releases.
>>
>> Unless you need extra drivers, installing from CRAN extras version is
>> probably the easiest.
>>
>> Roger
>>
>>>
>>> Alex Mandel <tech_dev at wildintellect.com> wrote:
>>>
>>>> On 06/17/2010 05:40 PM, tom sgouros wrote:
>>>>>
>>>>> Hello all:
>>>>>
>>>>> I read this in the rgdal documentation:
>>>>>
>>>>>> The GDAL and PROJ.4 libraries are external to the package, and, when
>>>>>> installing the package from source, must be correctly installed first.
>>>>>
>>>>> Does "correctly" mean something different from the default?  I installed
>>>>> PROJ.4 on my Mac OS X (10.6) machine, using 'make all' and 'make
>>>>> install'.  I saw no errors, and I see libproj.a sitting happily in
>>>>> /usr/local/lib which seems pretty standard to me, but when I try to
>>>>> install rgdal, I get this:
>>>>>
>>>>>   ...
>>>>>   checking proj_api.h usability... yes
>>>>>   checking proj_api.h presence... yes
>>>>>   checking for proj_api.h... yes
>>>>>   checking for pj_init_plus in -lproj... no
>>>>>   Error: libproj.a not found.
>>>>>   If the PROJ.4 library is installed in a non-standard location,
>>>>>   use --configure-args='--with-proj-lib=/opt/local/lib' for example,
>>>>>   replacing /opt/local/* with appropriate values for your installation.
>>>>>   If PROJ.4 is not installed, install it.
>>>>>
>>>>> Before it was installed, the configure choked on the line about
>>>>> proj_api.h.
>>>>>
>>>>> It was already installed, but per those directions, I tried this:
>>>>>
>>>>>> install.packages(c("rgdal"),
lib="/Library/Frameworks/R.framework/Resources/library",
contriburl=contrib.url(getOption("repos"),'source'),
type='source',
dependencies=TRUE,
configure.args=c(PROJ='--with-proj-lib=/usr/local/lib'))

>>>>>
>>>> Those instructions seem to indicate that it should be:
>>>> configure.args='--with-proj-lib=/usr/local/lib'
>>>> while the R code you put in may seem similar and theoretically provide
>>>> the same, try doing it exactly like the example.
>>>
>>> The example is from a command line invocation of ./configure.  How that
>>> relates to an install.packages() option wasn't obvious to me.  I was
>>> just copying the example in the install.packages() documentation.  But I
>>> tried it your way just now and it still doesn't work.  Same error.
>>> Besides, what's so non-standard about /usr/local/lib?
>>>
>>>>
>>>> The other option to consider is install Proj and GDAL from the Frameworks:
>>>> http://www.kyngchaos.com/software/frameworks
>>>>
>>>> I know people have gotten the frameworks to work.
>>>
>>> I'll try that, but I'm still mystified.
>>>
>>> Thank you,
>>>
>>> -tom
>>>
>>>
>>>>
>>>> Enjoy,
>>>> Alex
>>>>
>>>> _______________________________________________
>>>> R-sig-Geo mailing list
>>>> R-sig-Geo at stat.math.ethz.ch
>>>> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>>>>
>>>
>>>
>>>
>>
>> --
>> Roger Bivand
>> Economic Geography Section, Department of Economics, Norwegian School of
>> Economics and Business Administration, Helleveien 30, N-5045 Bergen,
>> Norway. voice: +47 55 95 93 55; fax +47 55 95 95 43
>> e-mail: Roger.Bivand at nhh.no
>>
>
>
>
>
>
>
>
>

--
Roger Bivand
Economic Geography Section, Department of Economics, Norwegian School of
Economics and Business Administration, Helleveien 30, N-5045 Bergen,
Norway. voice: +47 55 95 93 55; fax +47 55 95 95 43
e-mail: Roger.Bivand at nhh.no



------------------------------

_______________________________________________
R-sig-Geo mailing list
R-sig-Geo at stat.math.ethz.ch
https://stat.ethz.ch/mailman/listinfo/r-sig-geo


End of R-sig-Geo Digest, Vol 82, Issue 19



More information about the R-sig-Geo mailing list