[R-sig-Geo] 3D KDE to Triangular Irregular Network
andrewaduff at gmail.com
Sat Apr 13 07:31:52 CEST 2013
Thanks a lot Michael that was very helpful. It seems like you might be able
to make a TIN from one of the contour levels, say 75% or something. I'm not
really sure how to get to those isosurface vertex coordinates for a given
contour level. Is that possible in R.
From: r-sig-geo-bounces at r-project.org
[mailto:r-sig-geo-bounces at r-project.org] On Behalf Of Michael Sumner
Sent: Friday, April 12, 2013 2:06 PM
To: Duff, Andrew A (DFW)
Cc: r-sig-geo at r-project.org
Subject: Re: [R-sig-Geo] 3D KDE to Triangular Irregular Network
A TIN cannot represent that data structure, the plot shows multiple surfaces
that wrap around in 3D. (A TIN cannot do that). The plot is made by
"contouring" (isosurfaces) from a 3D array.
You can represent the array in NetCDF, and maybe your GIS can read that.
Otherwise you could do the same as here but create a 2D raster for every
slice in the 3rd dimension and reconstruct over there.
Bare bones using raster to NetCDF:
r <- brick(UD$estimate, xmn = min(UD$eval.points[]), xmx =
ymn = min(UD$eval.points[]), ymx = max(UD$eval.points[]))
## Plot each 3D slice
## write to NetCDF, you need ncdf or ncdf4 package writeRaster(r, "file.nc")
See ?writeRaster for further options to add descriptors to the file, and you
will likely need to worry about the orientation when making the raster
On Sat, Apr 13, 2013 at 4:29 AM, Duff, Andrew A (DFW) <
Andrew.Duff at dfw.wa.gov> wrote:
> I am interested in being able to export the results of a 3 dimensional
> kernel density estimate from the ks package in R to a format that
> could be viewed in 3D GIS application such as ESRI's ArcScene or
> ArcGlobe. I want to example the use of airspace in relation to
> terrain features. A TIN seems to be the most logical geospatial data
> structure that would support taking the 3D kde output into GIS. Does
> anybody have any ideas on how to get from a 3D kde output in ks to a
> tin. A self-contained sample of generating the kde is below.
> df <- data.frame("x"=sample(1:200, 10), "y"=sample(1:200, 10),
> "z"=sample(1:500, 10))
> Hpi1 <- Hpi(x = df)
> UD <- kde(x=df, H=Hpi1)
> Thanks in advance.
> [[alternative HTML version deleted]]
> R-sig-Geo mailing list
> R-sig-Geo at r-project.org
e-mail: mdsumner at gmail.com
[[alternative HTML version deleted]]
R-sig-Geo mailing list
R-sig-Geo at r-project.org
More information about the R-sig-Geo