Local plane fitting to Point Cloud

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Local plane fitting to Point Cloud

Ludwig Hilger
Dear list,

I have a huge (laser measurement) point cloud (Shapefile with Z as an attribute ("d.juli")) and I have also defined a SpatialGrid ("tdaten_SG") object whose cells I want to fill using local plane fitting, i.e. I want to fit a local plane to all points within a certain search distance around the cell's center and write the corresponding value to the grid cell (so this is DEM derivation from the points). I have tried the following:
krige(z ~ 1, locations = d.juli, newdata = tdaten_SG, maxdist = 0.5, nmax = 999)
But this does not seem to give the correct result (compared to other Software). In Bivand et al I find Figure 8.9 and I guess what I want is "local trend surface prediction"!? So I am wondering how to define and give a trend function or how to achieve the above in general.

Thank you dear list again and best regards,
Ludwig
Dipl. Geogr. Ludwig Hilger
Wiss. MA
Lehrstuhl für Physische Geographie
Katholische Universität Eichstätt-Ingolstadt
Ostenstraße 18
85072 Eichstätt

Tel.: 08421-93-1180
Reply | Threaded
Open this post in threaded view
|

Re: Local plane fitting to Point Cloud

edzer
Ludwig, try

library(gstat)
demo(meuse, ask=FALSE)
x = krige(zinc~1,meuse,meuse.grid,degree=1)
image(x)

add maxdist=800 or so to krige() for local first order trend surfaces.

On 06/05/2013 11:11 AM, Ludwig Hilger wrote:

> Dear list,
>
> I have a huge (laser measurement) point cloud (Shapefile with Z as an
> attribute ("d.juli")) and I have also defined a SpatialGrid ("tdaten_SG")
> object whose cells I want to fill using local plane fitting, i.e. I want to
> fit a local plane to all points within a certain search distance around the
> cell's center and write the corresponding value to the grid cell (so this is
> DEM derivation from the points). I have tried the following:
> krige(z ~ 1, locations = d.juli, newdata = tdaten_SG, maxdist = 0.5, nmax =
> 999)
> But this does not seem to give the correct result (compared to other
> Software). In Bivand et al I find Figure 8.9 and I guess what I want is
> "local trend surface prediction"!? So I am wondering how to define and give
> a trend function or how to achieve the above in general.
>
> Thank you dear list again and best regards,
> Ludwig
>
>
>
> -----
> Dipl. Geogr. Ludwig Hilger
> Wiss. MA
> Lehrstuhl für Physische Geographie
> Katholische Universität Eichstätt-Ingolstadt
> Ostenstraße 18
> 85072 Eichstätt
>
> Tel.: 08421-93-1180
> --
> View this message in context: http://r-sig-geo.2731867.n2.nabble.com/Local-plane-fitting-to-Point-Cloud-tp7583724.html
> Sent from the R-sig-geo mailing list archive at Nabble.com.
>
> _______________________________________________
> R-sig-Geo mailing list
> [hidden email]
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>

--
Edzer Pebesma
Institute for Geoinformatics (ifgi), University of Münster
Weseler Straße 253, 48151 Münster, Germany. Phone: +49 251
83 33081, Fax: +49 251 8339763 http://ifgi.uni-muenster.de

_______________________________________________
R-sig-Geo mailing list
[hidden email]
https://stat.ethz.ch/mailman/listinfo/r-sig-geo
Reply | Threaded
Open this post in threaded view
|

Re: Local plane fitting to Point Cloud

Ludwig Hilger
Dear Prof. Pebesma,

this worked perfectly, of course. I should have had a even closer look to krige's ... arguments :)

Thanks!
Dipl. Geogr. Ludwig Hilger
Wiss. MA
Lehrstuhl für Physische Geographie
Katholische Universität Eichstätt-Ingolstadt
Ostenstraße 18
85072 Eichstätt

Tel.: 08421-93-1180
Reply | Threaded
Open this post in threaded view
|

Re: Local plane fitting to Point Cloud

Ludwig Hilger
Hello everybody,

unfortunately I have to come up with a follow-up question. As described above, this has worked now perfecty at first with some of my data, but with another dataset (but it has the same structure, etc) I get the following error:

"solve.c", line 88: singular matrix in function Usolve()
Fehler in predict.gstat(g, newdata = newdata, block = block, nsim = nsim, :
 Usolve

I have no idea what my R is trying to tell me... any hints?

thank you again everybody,

Ludwig
Dipl. Geogr. Ludwig Hilger
Wiss. MA
Lehrstuhl für Physische Geographie
Katholische Universität Eichstätt-Ingolstadt
Ostenstraße 18
85072 Eichstätt

Tel.: 08421-93-1180
Reply | Threaded
Open this post in threaded view
|

Re: Local plane fitting to Point Cloud

edzer
Ludwig, your email does not contain the original posting, please include
or repeat in future mailings.

The original question was, I believe, about local fitting of trend surfaces.

This error can for instance happen when your neighbourhood is too small,
or does not contain enough information.

For a first order linear trend surface, a local neighbourhood should
have at least three points, and irrespective the neighbourhood size, the
points should not be aligned (on a straight line). My hint is that one
of these conditions is not met in your setup.

You can try to set debug level to powers of two (2, 8 or 16 seem
relevant) to get detailed input about the conditions under which this
happens.

On 06/10/2013 05:15 PM, Ludwig Hilger wrote:

> Hello everybody,
>
> unfortunately I have to come up with a follow-up question. As described
> above, this has worked now perfecty at first with some of my data, but with
> another dataset (but it has the same structure, etc) I get the following
> error:
>
> "solve.c", line 88: singular matrix in function Usolve()
> Fehler in predict.gstat(g, newdata = newdata, block = block, nsim = nsim, :
>  Usolve
>
> I have no idea what my R is trying to tell me... any hints?
>
> thank you again everybody,
>
> Ludwig
>
>
>
> -----
> Dipl. Geogr. Ludwig Hilger
> Wiss. MA
> Lehrstuhl für Physische Geographie
> Katholische Universität Eichstätt-Ingolstadt
> Ostenstraße 18
> 85072 Eichstätt
>
> Tel.: 08421-93-1180
> --
> View this message in context: http://r-sig-geo.2731867.n2.nabble.com/Local-plane-fitting-to-Point-Cloud-tp7583724p7583746.html
> Sent from the R-sig-geo mailing list archive at Nabble.com.
>
> _______________________________________________
> R-sig-Geo mailing list
> [hidden email]
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>

--
Edzer Pebesma
Institute for Geoinformatics (ifgi), University of Münster
Weseler Straße 253, 48151 Münster, Germany. Phone: +49 251
83 33081, Fax: +49 251 8339763 http://ifgi.uni-muenster.de

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