[R-sig-Geo] question

A.P.B. Carneiro apbc2 at cam.ac.uk
Mon Apr 1 16:13:59 CEST 2013


Dear all,

I am trying to calculate an area from a picture. I think I can use Spatial 
Analyst but I am not sure how to do it.

I have a picture from the wing of a bird, and from there, I want to 
calculate the area of a white patch. The picture is with a scale bar.

Is there a way to do that? There is not spatial information on the picture.

Thanks in advance,

Ana


On Sep 29 2012, r-sig-geo-request at r-project.org wrote:

>Send R-sig-Geo mailing list submissions to
>	r-sig-geo at r-project.org
>
>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 r-project.org
>
>You can reach the person managing the list at
>	r-sig-geo-owner at r-project.org
>
>When replying, please edit your Subject line so it is more specific
>than "Re: Contents of R-sig-Geo digest..."
>
>
>Today's Topics:
>
>   1. Re: plotting holes of esri shape files (Edzer Pebesma)
>   2. Re: basic question about plotKML (Struve,Juliane)
>   3. Re: basic question about plotKML (Edzer Pebesma)
>   4. Re: basic question about plotKML (Struve,Juliane)
>   5. Re: Create a raster brick from a netcdf using all levels
>      (Robert J. Hijmans)
>   6. Re: NaN / NA values in SpatialPixelDataFrame conversion
>      (Robert J. Hijmans)
>   7. Re: Error when trying to extract values for points in a
>      SpatialPointsDataFrame (Robert J. Hijmans)
>
>
>----------------------------------------------------------------------
>
>Message: 1
>Date: Fri, 28 Sep 2012 13:18:18 +0200
>From: Edzer Pebesma <edzer.pebesma at uni-muenster.de>
>To: "r-sig-geo at r-project.org" <r-sig-geo at r-project.org>
>Subject: Re: [R-sig-Geo] plotting holes of esri shape files
>Message-ID: <5065877A.5090805 at uni-muenster.de>
>Content-Type: text/plain; charset=ISO-8859-1
>
>Stefan,
>
>with the help of
>
>http://www.stat.auckland.ac.nz/~paul/R/Paths/MurrellPaths.pdf
>
>I corrected this in spplot. To run it, you'd need to compile from source
>on svn, or source this in your R session:
>
>  
> https://r-forge.r-project.org/scm/viewvc.php/*checkout*/pkg/sp/R/spplot.R?root=rspatial
>
>or wait for the next release on CRAN (due soon, I hope).
>
>spplot now also supports holes in polygons when the polygons are the
>main object to plot, contain holes, and something in the background
>should shine through.
>
>Building on the example in
>https://stat.ethz.ch/pipermail/r-sig-geo/2012-September/016116.html
>
>p1 = spplot(mask, col.regions='lightgrey',
>    sp.layout = list("sp.grid", as(dem_ascii, "SpatialGridDataFrame"),
>    col = bpy.colors(), first = TRUE), main = "spplot of mask")
>p2 = spplot(dem_ascii, col.regions=bpy.colors(), main = "spplot of dem",
>    sp.layout = list("sp.polygons", mask, fill = 'lightgray', first =
>FALSE))
>png('spplot.png', 600, 600)
>print(p1, split = c(1,1,1,2), more = TRUE)
>print(p2, split = c(1,2,1,2))
>dev.off()
>
>gives http://ifgi.uni-muenster.de/~epebe_01/spplot.png as output. Mind
>the legends.
>
>With best regards,
>
>On 09/20/2012 10:32 AM, sluedtke wrote:
>> Dear friends, 
>> 
>> 
>> am trying to overlay a polygon data set as a SpatialPolygonDateFrame to
>> an existing plot. The data set has a hole in the middle, and I do not
>> want to have any filling in there. If a check the shape in a GIS,
>> everything looks fine, but using the following commands to do the plot,
>> the hole is filled. 
>> 
>> That is the code I am using, the data is attached. Thanks in advance!
>> 
>> Stefan
>> 
>> 
>> 
>>  
>>  
>> ################################################################################################
>> 
>> library(sp)
>> library(rgdal)
>> library(raster)
>> library(latticeExtra)
>> 
>> 
>>  
>>  
>> ############################################################################################### 
>> #read the DEM from the ASCII format
>> 
>> dem_ascii=raster(readGDAL("./zerafshan_mod_dem.asc"))
>> 
>> 
>>  
>>  
>> ############################################################################################### 
>> # read additional data for printing mask=readOGR("./", "mask_zerafshan")
>> 
>>  
>>  
>> ###############################################################################################
>> 
>> #plot this stuff
>> plot_dem=spplot(dem_ascii, col.regions=terrain.colors(400),
>> colorkey=list(width=1, space="right"))+
>> layer(sp.polygons(mask,fill="lightgray"))
>> 
>> print(plot_dem) 
>> ################################################################################################
>> 
>> 
>> 
>> mask_zerafshan.dbf (110 bytes) 
>> <http://r-sig-geo.2731867.n2.nabble.com/attachment/7580992/0/mask_zerafshan.dbf> 
>> mask_zerafshan.prj (143 bytes) 
>> <http://r-sig-geo.2731867.n2.nabble.com/attachment/7580992/1/mask_zerafshan.prj> 
>> mask_zerafshan.shp (173K) 
>> <http://r-sig-geo.2731867.n2.nabble.com/attachment/7580992/2/mask_zerafshan.shp> 
>> mask_zerafshan.shx (150 bytes) 
>> <http://r-sig-geo.2731867.n2.nabble.com/attachment/7580992/3/mask_zerafshan.shx> 
>> zerafshan_mod_dem.asc (1M) 
>> <http://r-sig-geo.2731867.n2.nabble.com/attachment/7580992/4/zerafshan_mod_dem.asc>
>> 
>> 
>> 
>> 
>> -- View this message in context: 
>> http://r-sig-geo.2731867.n2.nabble.com/plotting-holes-of-esri-shape-files-tp7580992.html 
>> Sent from the R-sig-geo mailing list archive at Nabble.com.
>> 
>> _______________________________________________
>> R-sig-Geo mailing list
>> R-sig-Geo at r-project.org
>> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>> 
>
>

-- 

PhD student
Evolutionary Ecology Group
Department of Zoology
University of Cambridge



More information about the R-sig-Geo mailing list