[R-sig-Geo] Triangular Tessellation of Polygon

Roger Bivand Roger.Bivand at nhh.no
Tue Jul 24 20:17:20 CEST 2007


On Mon, 23 Jul 2007, GREGOR Brian J wrote:

> I am developing functions to plot 3d maps using the rgl package. I'm
> approaching the problem of plotting polygons by dividing polygons into
> triangular facets that then can be plotted as surfaces using the
> triangles3d function. This has turned out to be somewhat cumbersome
> using my approach which is as follows:
> 1) Use read.shape from maptools to read in a polygon shapefile
> 2) For each group of vertices describing a polygon:
> 	a) Apply the delaunayn function in the geometry package to get a
> Delaunay tessellation
> 	b) Remove triangles that have any segments whose center points
> are outside the polygon (using the point.in.polygon function from the sp
> package to identify these)
> 	c) Remove triangles that have any segments that cross a line
> segment comprising the polygon (using the crossing.psp function from the
> spatstat package to identify crossings)
> 	d) Build new triangles for polygon segments that were orphaned
> by steps b and c (to be done).
>
> This would be much simpler if there were a function to limit the
> tessellation to the interior of the polygon in the first place. Does
> anyone have or know of such a function? (Although there might be GIS
> tools to do this, I am only interested in a solution in R so that it can
> be used in R scripts.)

Have you looked at the triangulation code in the gpclib package, even 
though it is only 2D? Would it help pick out the internal triangles?

Roger

>
> Brian Gregor, P.E.
> Transportation Planning Analysis Unit
> Oregon Department of Transportation
> Brian.J.GREGOR at odot.state.or.us
> (503) 986-4120
>
> _______________________________________________
> 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




More information about the R-sig-Geo mailing list