Learn R Programming

spatstat.geom (version 3.5-0)

Geometrical Functionality of the 'spatstat' Family

Description

Defines spatial data types and supports geometrical operations on them. Data types include point patterns, windows (domains), pixel images, line segment patterns, tessellations and hyperframes. Capabilities include creation and manipulation of data (using command line or graphical interaction), plotting, geometrical operations (rotation, shift, rescale, affine transformation), convex hull, discretisation and pixellation, Dirichlet tessellation, Delaunay triangulation, pairwise distances, nearest-neighbour distances, distance transform, morphological operations (erosion, dilation, closing, opening), quadrat counting, geometrical measurement, geometrical covariance, colour maps, calculus on spatial domains, Gaussian blur, level sets of images, transects of images, intersections between objects, minimum distance matching. (Excludes spatial data on a network, which are supported by the package 'spatstat.linnet'.)

Copy Link

Version

Install

install.packages('spatstat.geom')

Monthly Downloads

64,669

Version

3.5-0

License

GPL (>= 2)

Maintainer

Adrian Baddeley

Last Published

July 20th, 2025

Functions in spatstat.geom (3.5-0)

Extract.ppp

Extract or Replace Subset of Point Pattern
Extract.quad

Subset of Quadrature Scheme
Extract.listof

Extract or Replace Subset of a List of Things
Extract.ppx

Extract Subset of Multidimensional Point Pattern
Extract.im

Extract Subset of Image
Extract.psp

Extract Subset of Line Segment Pattern
Extract.layered

Extract or Replace Subset of a Layered Object
Extract.owin

Extract Subset of Window
Extract.hyperframe

Extract or Replace Subset of Hyperframe
Extract.anylist

Extract or Replace Subset of a List of Things
NAobject

Make an NA Object
angles.psp

Orientation Angles of Line Segments
Extract.splitppp

Extract or Replace Sub-Patterns
Frame

Extract or Change the Containing Rectangle of a Spatial Object
Math.im

S3 Group Generic methods for images
affine.psp

Apply Affine Transformation To Line Segment Pattern
Replace.im

Reset Values in Subset of Image
Extract.solist

Extract or Replace Subset of a List of Spatial Objects
anyNA.im

Check Whether Image Contains NA Values
as.box3

Convert Data to Three-Dimensional Box
affine.ppp

Apply Affine Transformation To Point Pattern
Window

Extract or Change the Window of a Spatial Object
add.texture

Fill Plot With Texture
affine.tess

Apply Geometrical Transformation To Tessellation
Math.imlist

S3 Group Generic methods for List of Images
anylist

List of Objects
Window.tess

Extract Window of Spatial Object
as.data.frame.tess

Convert Tessellation to Data Frame
Extract.tess

Extract or Replace Subset of Tessellation
affine.owin

Apply Affine Transformation To Window
as.boxx

Convert Data to Multi-Dimensional Box
MinkowskiSum

Minkowski Sum of Windows
as.data.frame.psp

Coerce Line Segment Pattern to a Data Frame
as.hyperframe

Convert Data to Hyperframe
as.data.frame.hyperframe

Coerce Hyperframe to Data Frame
as.data.frame.ppp

Coerce Point Pattern to a Data Frame
as.function.im

Convert Pixel Image to Function of Coordinates
as.hyperframe.ppx

Extract coordinates and marks of multidimensional point pattern
append.psp

Combine Two Line Segment Patterns
as.colourmap

Convert to Colour Map
affine

Apply Affine Transformation
affine.im

Apply Affine Transformation To Pixel Image
area.owin

Area of a Window
as.function.owin

Convert Window to Indicator Function
applynbd

Apply Function to Every Neighbourhood in a Point Pattern
areaGain

Difference of Disc Areas
as.psp

Convert Data To Class psp
as.layered

Convert Data To Layered Object
as.im

Convert to Pixel Image
as.function.tess

Convert a Tessellation to a Function
border

Border Region of a Window
as.data.frame.im

Convert Pixel Image to Data Frame
as.rectangle

Window Frame
bounding.box.xy

Convex Hull of Points
areaLoss

Difference of Disc Areas
closing

Morphological Closing
beachcolours

Create Colour Scheme for a Range of Numbers
clickdist

Interactively Measure Distance
colourmap

Colour Lookup Tables
as.polygonal

Convert a Window to a Polygonal Window
closepairs

Close Pairs of Points
boundingcircle

Smallest Enclosing Circle
bdist.tiles

Distance to Boundary of Window
as.mask

Pixel Image Approximation of a Window
boundingbox

Bounding Box of a Window, Image, or Point Pattern
as.matrix.im

Convert Pixel Image to Matrix or Array
clickbox

Interactively Define a Rectangle
box3

Three-Dimensional Box
clip.infline

Intersect Infinite Straight Lines with a Window
by.ppp

Apply a Function to a Point Pattern Broken Down by Factor
as.data.frame.owin

Convert Window to Data Frame
contour.im

Contour plot of pixel image
contour.imlist

Array of Contour Plots
as.matrix.owin

Convert Pixel Image to Matrix
as.tess

Convert Data To Tessellation
as.owin

Convert Data To Class owin
as.solist

Convert List of Two-Dimensional Spatial Objects
as.ppp

Convert Data To Class ppp
complement.owin

Take Complement of a Window
compatible.im

Test Whether Pixel Images Are Compatible
cbind.hyperframe

Combine Hyperframes by Rows or by Columns
colouroutputs

Extract or Assign Colour Values in a Colour Map
bufftess

Buffer Distance Tessellation
by.im

Apply Function to Image Broken Down by Factor
bdist.pixels

Distance to Boundary of Window
bdist.points

Distance to Boundary of Window
convexify

Weil's Convexifying Operation
convolve.im

Convolution of Pixel Images
coords

Extract or Change Coordinates of a Spatial or Spatiotemporal Point Pattern
convexmetric

Distance Metric Defined by Convex Set
crossdist.pp3

Pairwise distances between two different three-dimensional point patterns
crossdist.ppp

Pairwise distances between two different point patterns
crossdist

Pairwise distances
closepairs.pp3

Close Pairs of Points in 3 Dimensions
closetriples

Close Triples of Points
concatxy

Concatenate x,y Coordinate Vectors
boxx

Multi-Dimensional Box
commonGrid

Determine A Common Spatial Domain And Pixel Resolution
colourtools

Convert and Compare Colours in Different Formats
connected

Connected components
compatible

Test Whether Objects Are Compatible
deltametric

Delta Metric
diameter

Diameter of an Object
convexhull

Convex Hull
centroid.owin

Centroid of a window
delaunayDistance

Distance on Delaunay Triangulation
convexhull.xy

Convex Hull of Points
default.dummy

Generate a Default Pattern of Dummy Points
cut.ppp

Classify Points in a Point Pattern
diameter.box3

Geometrical Calculations for Three-Dimensional Box
dilated.areas

Areas of Morphological Dilations
crossdist.default

Pairwise distances between two different sets of points
dilation

Morphological Dilation
diameter.boxx

Geometrical Calculations for Multi-Dimensional Box
diameter.owin

Diameter of a Window
crossing.psp

Crossing Points of Two Line Segment Patterns
cut.im

Convert Pixel Image from Numeric to Factor
chop.tess

Subdivide a Window or Tessellation using a Set of Lines
dirichlet

Dirichlet Tessellation of Point Pattern
clickpoly

Interactively Define a Polygon
dirichletVertices

Vertices and Edges of Dirichlet Tessellation
edges

Extract Boundary Edges of a Window.
duplicated.ppp

Determine Duplicated Points in a Spatial Point Pattern
domain

Extract the Domain of any Spatial Object
extrapolate.psp

Extrapolate Line Segments to Obtain Infinite Lines
dirichletAreas

Compute Areas of Tiles in Dirichlet Tessellation
corners

Corners of a rectangle
ellipse

Elliptical Window.
distmap

Distance Map
distmap.psp

Distance Map of Line Segment Pattern
connected.ppp

Connected Components of a Point Pattern
fardist

Farthest Distance to Boundary of Window
crossdist.ppx

Pairwise Distances Between Two Different Multi-Dimensional Point Patterns
connected.tess

Connected Components of Tiles of a Tessellation
default.image.colours

Default Colours for Images in Spatstat
covering

Cover Region with Discs
clickppp

Interactively Add Points
endpoints.psp

Endpoints of Line Segment Pattern
grow.rectangle

Add margins to rectangle
disc

Circular Window
dirichletWeights

Compute Quadrature Weights Based on Dirichlet Tessellation
harmonise

Make Objects Compatible
distfun

Distance Map as a Function
discpartarea

Area of Part of Disc
crossdist.psp

Pairwise distances between two different line segment patterns
eroded.areas

Areas of Morphological Erosions
distmap.ppp

Distance Map of Point Pattern
distmap.owin

Distance Map of Window
identify.ppp

Identify Points in a Point Pattern
hyperframe

Hyper Data Frame
fourierbasis

Fourier Basis Functions
erosion

Morphological Erosion by a Disc
funxy

Spatial Function Class
edit.ppp

Invoke Text Editor on Spatial Data
integral.tessfun

Integrate a Function Which is Constant on Each Tile of a Tessellation
integral.im

Integral of a Pixel Image
interp.im

Interpolate a Pixel Image
infline

Infinite Straight Lines
intersect.boxx

Intersection Of Boxes Of Arbitrary Dimension
intensity.ppx

Intensity of a Multidimensional Space-Time Point Pattern
is.connected

Determine Whether an Object is Connected
intensity.psp

Empirical Intensity of Line Segment Pattern
is.connected.ppp

Determine Whether a Point Pattern is Connected
is.convex

Test Whether a Window is Convex
is.owin

Test Whether An Object Is A Window
is.empty

Test Whether An Object Is Empty
is.marked

Test Whether Marks Are Present
is.marked.ppp

Test Whether A Point Pattern is Marked
is.na.hyperframe

Identify Missing Entries in a Hyperframe
is.subset.owin

Determine Whether One Window is Contained In Another
is.rectangle

Determine Type of Window
im.apply

Apply Function Pixelwise to List of Images
hist.im

Histogram of Pixel Values in an Image
is.linnet

Test Whether An Object Is A Linear Network
interp.colourmap

Interpolate smoothly between specified colours
im

Create a Pixel Image Object
intensity.quadratcount

Intensity Estimates Using Quadrat Counts
methods.box3

Methods for Three-Dimensional Box
intersect.tess

Intersection of Two Tessellations
intersect.owin

Intersection, Union or Set Subtraction of Windows
layout.boxes

Generate a Row or Column Arrangement of Rectangles.
lengths_psp

Lengths of Line Segments
is.na.solist

Identify Missing Entries in a List of Spatial Objects
methods.boxx

Methods for Multi-Dimensional Box
methods.pp3

Methods for three-dimensional point patterns
methods.layered

Methods for Layered Objects
invoke.symbolmap

Plot Data Using Graphics Symbol Map
marks

Marks of a Point Pattern
invoke.metric

Perform Geometric Task using a Specified Metric
nndist.ppx

Nearest Neighbour Distances in Any Dimensions
nndist.psp

Nearest neighbour distances between line segments
nnwhich.pp3

Nearest neighbours in three dimensions
nncross.pp3

Nearest Neighbours Between Two Patterns in 3D
nnwhich.ppx

Nearest Neighbours in Any Dimensions
nncross.ppx

Nearest Neighbours Between Two Patterns in Any Dimensions
opening

Morphological Opening
overlap.owin

Compute Area of Overlap
owin

Create a Window
owin.object

Class owin
owin2mask

Convert Window to Binary Mask under Constraints
pHcolourmap

Colour Map for pH Values
persp.ppp

Perspective Plot of Marked Point Pattern
nvertices

Count Number of Vertices
pairdist

Pairwise distances
nsegments

Number of Line Segments in a Line Segment Pattern
padimage

Pad the Border of a Pixel Image
perspPoints

Draw Points or Lines on a Surface Viewed in Perspective
pairdist.psp

Pairwise distances between line segments
edges2triangles

List Triangles in a Graph
eval.im

Evaluate Expression Involving Pixel Images
erosionAny

Morphological Erosion of Windows
edit.hyperframe

Invoke Text Editor on Hyperframe
framedist.pixels

Distance to Bounding Frame
discretise

Safely Convert Point Pattern Window to Binary Mask
default.symbolmap

Default Symbol Map for Plotting a Spatial Pattern
discs

Union of Discs
hextess

Hexagonal Grid or Tessellation
headtail

First or Last Part of a Spatial Pattern
gridweights

Compute Quadrature Weights Based on Grid Counts
imcov

Spatial Covariance of a Pixel Image
identify.psp

Identify Segments in a Line Segment Pattern
im.object

Class of Images
grow.boxx

Add margins to box in any dimension
identify.tess

Interactively Identify Tiles of a Tessellation
inside.owin

Test Whether Points Are Inside A Window
gridcentres

Rectangular grid of points
inside.boxx

Test Whether Points Are Inside A Multidimensional Box
harmoniseLevels

Harmonise the levels of several factors, or factor-valued pixel images.
intensity

Intensity of a Dataset or a Model
has.close

Check Whether Points Have Close Neighbours
intensity.ppp

Empirical Intensity of Point Pattern
is.NAobject

Recognise NA Objects
is.im

Test Whether An Object Is A Pixel Image
incircle

Find Largest Circle Inside Window
is.multitype

Test whether Object is Multitype
is.ppp

Test Whether An Object Is A Point Pattern
is.boxx

Recognise a Multi-Dimensional Box
delaunay

Delaunay Triangulation of Point Pattern
is.linim

Test Whether an Object is a Pixel Image on a Linear Network
edges2vees

List Dihedral Triples in a Graph
fillholes.owin

Remove Small Holes in a Window
flipxy

Exchange X and Y Coordinates
default.symbolmap.ppp

Default Symbol Map for Point Pattern
lut

Lookup Tables
harmonise.im

Make Pixel Images Compatible
marks.tess

Marks of a Tessellation
markstat

Summarise Marks in Every Neighbourhood in a Point Pattern
levelset

Level Set of a Pixel Image
is.multitype.ppp

Test Whether A Point Pattern is Multitype
hist.funxy

Histogram of Values of a Spatial Function
harmonise.owin

Make Windows Compatible
midpoints.psp

Midpoints of Line Segment Pattern
methods.distfun

Geometrical Operations for Distance Functions
methods.ppx

Methods for Multidimensional Space-Time Point Patterns
methods.funxy

Methods for Spatial Functions
metric.object

Distance Metric
is.lpp

Test Whether An Object Is A Point Pattern on a Linear Network
methods.unitname

Methods for Units
matchingdist

Distance for a Point Pattern Matching
nearest.raster.point

Find Pixel Nearest to a Given Point
layered

Create List of Plotting Layers
layerplotargs

Extract or Replace the Plot Arguments of a Layered Object
maxnndist

Compute Minimum or Maximum Nearest-Neighbour Distance
multiplicity.ppp

Count Multiplicity of Duplicate Points
marks.psp

Marks of a Line Segment Pattern
mean.im

Mean and Median of Pixel Values in an Image
mergeLevels

Merge Levels of a Factor
pairdist.pp3

Pairwise distances in Three Dimensions
nearestValue

Image of Nearest Defined Pixel Value
pairdist.default

Pairwise distances
pixellate.owin

Convert Window to Pixel Image
pixellate.ppp

Convert Point Pattern to Pixel Image
perimeter

Perimeter Length of Window
periodify

Make Periodic Copies of a Spatial Pattern
persp.im

Perspective Plot of Pixel Image
plot.anylist

Plot a List of Things
plot.colourmap

Plot a Colour Map
plot.im

Plot a Pixel Image
plot.hyperframe

Plot Entries in a Hyperframe
plot.onearrow

Plot an Arrow
plot.listof

Plot a List of Things
plot.solist

Plot a List of Spatial Objects
plot.pppmatching

Plot a Point Matching
plot.quad

Plot a Spatial Quadrature Scheme
polartess

Tessellation Using Polar Coordinates
plot.textstring

Plot a Text String
pp3

Three Dimensional Point Pattern
plot.tess

Plot a Tessellation
plot.texturemap

Plot a Texture Map
pointsOnLines

Place Points Evenly Along Specified Lines
ppp

Create a Point Pattern
plot.yardstick

Plot a Yardstick or Scale Bar
pppdist

Distance Between Two Point Patterns
print.quad

Print a Quadrature Scheme
pppmatching

Create a Point Matching
pppmatching.object

Class of Point Matchings
psp2mask

Convert Line Segment Pattern to Binary Pixel Mask
psp.object

Class of Line Segment Patterns
quadscheme.logi

Generate a Logistic Regression Quadrature Scheme from a Point Pattern
print.im

Print Brief Details of an Image
raster.x

Cartesian Coordinates for a Pixel Raster
rectdistmap

Distance Map Using Rectangular Distance Metric
rescale.owin

Convert Window to Another Unit of Length
rescale.ppp

Convert Point Pattern to Another Unit of Length
requireversion

Require a Specific Version of a Package
rsyst

Simulate systematic random point pattern
rescale

Convert dataset to another unit of length
selfcut.psp

Cut Line Segments Where They Intersect
relevel.im

Reorder Levels of a Factor-Valued Image or Pattern
quadratcount

Quadrat counting for a point pattern
rexplode

Explode a Point Pattern by Displacing Duplicated Points
restrict.colourmap

Restrict a Colour Map to a Subset of Values
quad.object

Class of Quadrature Schemes
rescale.psp

Convert Line Segment Pattern to Another Unit of Length
rotate.im

Rotate a Pixel Image
rotate.infline

Rotate or Shift Infinite Lines
simplify.owin

Approximate a Window by a Simpler Polygon
simplepanel

Simple Point-and-Click Interface Panels
run.simplepanel

Run Point-and-Click Interface
rescue.rectangle

Convert Window Back To Rectangle
shift.im

Apply Vector Translation To Pixel Image
shift.owin

Apply Vector Translation To Window
shift

Apply Vector Translation
shift.ppp

Apply Vector Translation To Point Pattern
shift.ppx

Apply Vector Translation To Box Or Point Pattern In Arbitrary Dimension
runifrect

Generate N Uniform Random Points in a Rectangle
split.im

Divide Image Into Sub-images
split.hyperframe

Divide Hyperframe Into Subsets and Reassemble
solist

List of Two-Dimensional Spatial Objects
solapply

Apply a Function Over a List and Obtain a List of Objects
solutionset

Evaluate Logical Expression Involving Pixel Images and Return Region Where Expression is True
spatdim

Spatial Dimension of a Dataset
summary.anylist

Summary of a List of Things
subset.hyperframe

Subset of Hyperframe Satisfying A Condition
stratrand

Stratified random point pattern
summary.distfun

Summarizing a Function of Spatial Location
square

Square Window
spokes

Spokes pattern of dummy points
superimpose

Superimpose Several Geometric Patterns
summary.psp

Summary of a Line Segment Pattern Dataset
symbolmap

Graphics Symbol Map
summary.owin

Summary of a Spatial Window
summary.solist

Summary of a List of Spatial Objects
summary.splitppp

Summary of a Split Point Pattern
summary.ppp

Summary of a Point Pattern Dataset
summary.im

Summarizing a Pixel Image
tess

Create a Tessellation
test.crossing.psp

Check Whether Segments Cross
uniquemap.ppp

Map Duplicate Entries to Unique Entries
tile.areas

Compute Areas of Tiles in a Tessellation
textureplot

Plot Image or Tessellation Using Texture Fill
tweak.colourmap

Change Colour Values in a Colour Map
trim.rectangle

Cut margins from rectangle
unique.ppp

Extract Unique Points from a Spatial Point Pattern
union.quad

Union of Data and Dummy Points
unstack.solist

Unstack Each Spatial Object in a List of Objects
update.symbolmap

Update a Graphics Symbol Map.
unstack.ppp

Separate Multiple Columns of Marks
with.hyperframe

Evaluate an Expression in Each Row of a Hyperframe
whichhalfplane

Test Which Side of Infinite Line a Point Falls On
nearestsegment

Find Line Segment Nearest to Each Point
npoints

Number of Points in a Point Pattern
nobjects

Count Number of Geometrical Objects in a Spatial Dataset
pairdist.ppp

Pairwise distances
pixelcentres

Extract Pixel Centres as Point Pattern
pixellate.psp

Convert Line Segment Pattern to Pixel Image
pixelquad

Quadrature Scheme Based on Pixel Grid
plot.quadratcount

Plot Quadrat Counts
plot.pp3

Plot a Three-Dimensional Point Pattern
plot.owin

Plot a Spatial Window
plot.psp

plot a Spatial Line Segment Pattern
ppp.object

Class of Point Patterns
ppx

Multidimensional Space-Time Point Pattern
print.owin

Print Brief Details of a Spatial Window
print.ppp

Print Brief Details of a Point Pattern Dataset
rQuasi

Generate Quasirandom Point Pattern in Given Window
quasirandom

Quasirandom Patterns
reflect

Reflect In Origin
rotate.owin

Rotate a Window
rotate.ppp

Rotate a Point Pattern
ripras

Estimate window from points alone
quantilefun.im

Quantile Function for Images
rjitter

Random Perturbation of a Point Pattern
scalardilate

Apply Scalar Dilation
scaletointerval

Rescale Data to Lie Between Specified Limits
spatstat.geom-package

The spatstat.geom Package
sidelengths.owin

Side Lengths of Enclosing Rectangle of a Window
shift.psp

Apply Vector Translation To Line Segment Pattern
subset.ppp

Subset of Point Pattern Satisfying A Condition
subset.psp

Subset of Line Segment Satisfying A Condition
summary.listof

Summary of a List of Things
summary.quad

Summarizing a Quadrature Scheme
text.ppp

Add Text Labels to Spatial Pattern
texturemap

Texture Map
tiles.empty

Check For Empty Tiles in a Tessellation
tiles

Extract List of Tiles in a Tessellation
transmat

Convert Pixel Array Between Different Conventions
unitname

Name for Unit of Length
vertices

Vertices of a Window
venn.tess

Tessellation Delimited by Several Sets
nnmark

Mark of Nearest Neighbour
nnwhich

Nearest neighbour
nnmap

K-th Nearest Point Map
nnfun

Nearest Neighbour Index Map as a Function
nndist

Nearest neighbour distances
pairdist.ppx

Pairwise Distances in Any Dimensions
nndist.pp3

Nearest neighbour distances in three dimensions
nncross

Nearest Neighbours Between Two Patterns
nestsplit

Nested Split
pixellate

Convert Spatial Object to Pixel Image
plot.imlist

Plot a List of Images
plot.layered

Layered Plot
plot.symbolmap

Plot a Graphics Symbol Map
plot.splitppp

Plot a List of Point Patterns
plot.ppp

plot a Spatial Point Pattern
progressreport

Print Progress Reports
print.psp

Print Brief Details of a Line Segment Pattern Dataset
quantess

Quantile Tessellation
project2segment

Move Point To Nearest Line
project2set

Find Nearest Point in a Region
psp

Create a Line Segment Pattern
quantile.im

Sample Quantiles of Pixel Image
quadscheme

Generate a Quadrature Scheme from a Point Pattern
regularpolygon

Create A Regular Polygon
quadrats

Divide Region into Quadrats
rlinegrid

Generate grid of parallel lines with random displacement
rescale.im

Convert Pixel Image to Another Unit of Length
rotate

Rotate
rounding.ppp

Detect Numerical Rounding
rgbim

Create Colour-Valued Pixel Image
sessionLibs

Print Names and Version Numbers of Libraries Loaded
rotate.psp

Rotate a Line Segment Pattern
setcov

Set Covariance of a Window
selfcrossing.psp

Crossing Points in a Line Segment Pattern
rev.colourmap

Reverse the Colours in a Colour Map
scanpp

Read Point Pattern From Data File
round.ppp

Apply Numerical Rounding to Spatial Coordinates
tileindex

Determine Which Tile Contains Each Given Point
tilenames

Names of Tiles in a Tessellation
timeTaken

Extract the Total Computation Time
timed

Record the Computation Time
unmark

Remove Marks
spatstat.geom-deprecated

Deprecated spatstat.geom functions
spatstat.geom-internal

Internal spatstat.geom functions
volume

Volume of an Object
where.max

Find Location of Maximum in a Pixel Image
zapsmall.im

Rounding of Pixel Values
yardstick

Text, Arrow or Scale Bar in a Diagram
triangulate.owin

Decompose Window into Triangles
spatstat.options

Internal Options in Spatstat Package
split.ppp

Divide Point Pattern into Sub-patterns
split.ppx

Divide Multidimensional Point Pattern into Sub-patterns