Learn R Programming

spatstat.geom (version 3.6-1)

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

98,308

Version

3.6-1

License

GPL (>= 2)

Maintainer

Adrian Baddeley

Last Published

November 20th, 2025

Functions in spatstat.geom (3.6-1)

Extract.im

Extract Subset of Image
Extract.quad

Subset of Quadrature Scheme
Extract.psp

Extract Subset of Line Segment Pattern
Extract.listof

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

Extract Subset of Window
Extract.ppp

Extract or Replace Subset of Point Pattern
Extract.ppx

Extract Subset of Multidimensional Point Pattern
Extract.anylist

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

Extract or Replace Subset of Hyperframe
Extract.layered

Extract or Replace Subset of a Layered Object
Extract.tess

Extract or Replace Subset of Tessellation
Replace.im

Reset Values in Subset of Image
Math.im

S3 Group Generic methods for images
Extract.splitppp

Extract or Replace Sub-Patterns
Frame

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

S3 Group Generic methods for List of Images
NAobject

Make an NA Object
MinkowskiSum

Minkowski Sum of Windows
Window

Extract or Change the Window of a Spatial Object
Extract.solist

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

Apply Affine Transformation To Pixel Image
affine

Apply Affine Transformation
affine.psp

Apply Affine Transformation To Line Segment Pattern
add.texture

Fill Plot With Texture
affine.tess

Apply Geometrical Transformation To Tessellation
affine.owin

Apply Affine Transformation To Window
angles.psp

Orientation Angles of Line Segments
anyNA.im

Check Whether Image Contains NA Values
Window.tess

Extract Window of Spatial Object
affine.ppp

Apply Affine Transformation To Point Pattern
areaGain

Difference of Disc Areas
as.colourmap

Convert to Colour Map
anylist

List of Objects
as.box3

Convert Data to Three-Dimensional Box
areaLoss

Difference of Disc Areas
append.psp

Combine Two Line Segment Patterns
as.data.frame.hyperframe

Coerce Hyperframe to Data Frame
as.boxx

Convert Data to Multi-Dimensional Box
as.data.frame.psp

Coerce Line Segment Pattern to a Data Frame
as.data.frame.ppp

Coerce Point Pattern to a Data Frame
as.hyperframe.ppx

Extract coordinates and marks of multidimensional point pattern
area.owin

Area of a Window
as.data.frame.owin

Convert Window to Data Frame
as.hyperframe

Convert Data to Hyperframe
as.function.tess

Convert a Tessellation to a Function
as.data.frame.tess

Convert Tessellation to Data Frame
applynbd

Apply Function to Every Neighbourhood in a Point Pattern
as.function.owin

Convert Window to Indicator Function
as.function.im

Convert Pixel Image to Function of Coordinates
as.data.frame.im

Convert Pixel Image to Data Frame
as.mask

Pixel Image Approximation of a Window
as.polygonal

Convert a Window to a Polygonal Window
as.im

Convert to Pixel Image
as.rectangle

Window Frame
as.layered

Convert Data To Layered Object
as.psp

Convert Data To Class psp
as.matrix.owin

Convert Pixel Image to Matrix
as.owin

Convert Data To Class owin
as.ppp

Convert Data To Class ppp
boundingbox

Bounding Box of a Window, Image, or Point Pattern
bdist.tiles

Distance to Boundary of Window
as.matrix.im

Convert Pixel Image to Matrix or Array
beachcolours

Create Colour Scheme for a Range of Numbers
bdist.points

Distance to Boundary of Window
bdist.pixels

Distance to Boundary of Window
boundingcircle

Smallest Enclosing Circle
as.solist

Convert List of Two-Dimensional Spatial Objects
by.im

Apply Function to Image Broken Down by Factor
as.tess

Convert Data To Tessellation
bufftess

Buffer Distance Tessellation
clickbox

Interactively Define a Rectangle
clickdist

Interactively Measure Distance
border

Border Region of a Window
chop.tess

Subdivide a Window or Tessellation using a Set of Lines
bounding.box.xy

Convex Hull of Points
centroid.owin

Centroid of a window
boxx

Multi-Dimensional Box
box3

Three-Dimensional Box
by.ppp

Apply a Function to a Point Pattern Broken Down by Factor
clip.infline

Intersect Infinite Straight Lines with a Window
clickpoly

Interactively Define a Polygon
cbind.hyperframe

Combine Hyperframes by Rows or by Columns
closepairs

Close Pairs of Points
closepairs.pp3

Close Pairs of Points in 3 Dimensions
closetriples

Close Triples of Points
clickppp

Interactively Add Points
compatible.im

Test Whether Pixel Images Are Compatible
complement.owin

Take Complement of a Window
commonGrid

Determine A Common Spatial Domain And Pixel Resolution
compatible

Test Whether Objects Are Compatible
concatxy

Concatenate x,y Coordinate Vectors
connected

Connected components
coords

Extract or Change Coordinates of a Spatial or Spatiotemporal Point Pattern
connected.tess

Connected Components of Tiles of a Tessellation
connected.ppp

Connected Components of a Point Pattern
convolve.im

Convolution of Pixel Images
convexmetric

Distance Metric Defined by Convex Set
convexify

Weil's Convexifying Operation
crossdist.default

Pairwise distances between two different sets of points
crossdist

Pairwise distances
colourtools

Convert and Compare Colours in Different Formats
colouroutputs

Extract or Assign Colour Values in a Colour Map
closing

Morphological Closing
contour.imlist

Array of Contour Plots
convexhull

Convex Hull
contour.im

Contour plot of pixel image
convexhull.xy

Convex Hull of Points
crossdist.psp

Pairwise distances between two different line segment patterns
crossing.psp

Crossing Points of Two Line Segment Patterns
covering

Cover Region with Discs
corners

Corners of a rectangle
colourmap

Colour Lookup Tables
default.image.colours

Default Colours for Images in Spatstat
cut.im

Convert Pixel Image from Numeric to Factor
default.symbolmap

Default Symbol Map for Plotting a Spatial Pattern
crossdist.ppx

Pairwise Distances Between Two Different Multi-Dimensional Point Patterns
crossdist.ppp

Pairwise distances between two different point patterns
cut.ppp

Classify Points in a Point Pattern
crossdist.pp3

Pairwise distances between two different three-dimensional point patterns
diameter

Diameter of an Object
diameter.box3

Geometrical Calculations for Three-Dimensional Box
default.symbolmap.ppp

Default Symbol Map for Point Pattern
delaunayDistance

Distance on Delaunay Triangulation
deltametric

Delta Metric
default.dummy

Generate a Default Pattern of Dummy Points
dilation

Morphological Dilation
dilated.areas

Areas of Morphological Dilations
diameter.owin

Diameter of a Window
dirichletWeights

Compute Quadrature Weights Based on Dirichlet Tessellation
diameter.boxx

Geometrical Calculations for Multi-Dimensional Box
dirichletVertices

Vertices and Edges of Dirichlet Tessellation
dirichlet

Dirichlet Tessellation of Point Pattern
dirichletAreas

Compute Areas of Tiles in Dirichlet Tessellation
disc

Circular Window
discpartarea

Area of Part of Disc
discretise

Safely Convert Point Pattern Window to Binary Mask
discs

Union of Discs
delaunay

Delaunay Triangulation of Point Pattern
distmap

Distance Map
distfun

Distance Map as a Function
domain

Extract the Domain of any Spatial Object
edit.ppp

Invoke Text Editor on Spatial Data
edit.hyperframe

Invoke Text Editor on Hyperframe
edges

Extract Boundary Edges of a Window.
duplicated.ppp

Determine Duplicated Points in a Spatial Point Pattern
distmap.psp

Distance Map of Line Segment Pattern
edges2triangles

List Triangles in a Graph
edges2vees

List Dihedral Triples in a Graph
distmap.owin

Distance Map of Window
fillholes.owin

Remove Small Holes in a Window
ellipse

Elliptical Window.
erosionAny

Morphological Erosion of Windows
extrapolate.psp

Extrapolate Line Segments to Obtain Infinite Lines
distmap.ppp

Distance Map of Point Pattern
fardist

Farthest Distance to Boundary of Window
flipxy

Exchange X and Y Coordinates
erosion

Morphological Erosion by a Disc
eval.im

Evaluate Expression Involving Pixel Images
eroded.areas

Areas of Morphological Erosions
harmonise

Make Objects Compatible
grow.rectangle

Add margins to rectangle
gridweights

Compute Quadrature Weights Based on Grid Counts
grow.boxx

Add margins to box in any dimension
framedist.pixels

Distance to Bounding Frame
fourierbasis

Fourier Basis Functions
gridcentres

Rectangular grid of points
funxy

Spatial Function Class
endpoints.psp

Endpoints of Line Segment Pattern
identify.psp

Identify Segments in a Line Segment Pattern
identify.tess

Interactively Identify Tiles of a Tessellation
harmonise.im

Make Pixel Images Compatible
harmonise.owin

Make Windows Compatible
hist.im

Histogram of Pixel Values in an Image
hist.funxy

Histogram of Values of a Spatial Function
has.close

Check Whether Points Have Close Neighbours
harmoniseLevels

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

Integral of a Pixel Image
hextess

Hexagonal Grid or Tessellation
inside.boxx

Test Whether Points Are Inside A Multidimensional Box
inside.owin

Test Whether Points Are Inside A Window
imcov

Spatial Covariance of a Pixel Image
im.apply

Apply Function Pixelwise to List of Images
headtail

First or Last Part of a Spatial Pattern
im.object

Class of Images
im

Create a Pixel Image Object
integral.tessfun

Integrate a Function Which is Constant on Each Tile of a Tessellation
hyperframe

Hyper Data Frame
identify.ppp

Identify Points in a Point Pattern
infline

Infinite Straight Lines
incircle

Find Largest Circle Inside Window
intensity.ppx

Intensity of a Multidimensional Space-Time Point Pattern
intensity.quadratcount

Intensity Estimates Using Quadrat Counts
intersect.owin

Intersection, Union or Set Subtraction of Windows
intensity

Intensity of a Dataset or a Model
intensity.ppp

Empirical Intensity of Point Pattern
interp.im

Interpolate a Pixel Image
intersect.boxx

Intersection Of Boxes Of Arbitrary Dimension
is.connected.ppp

Determine Whether a Point Pattern is Connected
is.connected

Determine Whether an Object is Connected
intersect.tess

Intersection of Two Tessellations
interp.colourmap

Interpolate smoothly between specified colours
is.im

Test Whether An Object Is A Pixel Image
is.linim

Test Whether an Object is a Pixel Image on a Linear Network
invoke.metric

Perform Geometric Task using a Specified Metric
intensity.psp

Empirical Intensity of Line Segment Pattern
is.multitype.ppp

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

Identify Missing Entries in a Hyperframe
invoke.symbolmap

Plot Data Using Graphics Symbol Map
is.na.solist

Identify Missing Entries in a List of Spatial Objects
is.owin

Test Whether An Object Is A Window
is.multitype

Test whether Object is Multitype
is.linnet

Test Whether An Object Is A Linear Network
is.marked

Test Whether Marks Are Present
is.empty

Test Whether An Object Is Empty
is.marked.ppp

Test Whether A Point Pattern is Marked
is.convex

Test Whether a Window is Convex
is.NAobject

Recognise NA Objects
is.ppp

Test Whether An Object Is A Point Pattern
is.boxx

Recognise a Multi-Dimensional Box
layout.boxes

Generate a Row or Column Arrangement of Rectangles.
layered

Create List of Plotting Layers
layerplotargs

Extract or Replace the Plot Arguments of a Layered Object
lengths_psp

Lengths of Line Segments
marks.psp

Marks of a Line Segment Pattern
marks

Marks of a Point Pattern
marks.tess

Marks of a Tessellation
is.subset.owin

Determine Whether One Window is Contained In Another
is.rectangle

Determine Type of Window
mean.im

Mean and Median of Pixel Values in an Image
methods.distfun

Geometrical Operations for Distance Functions
levelset

Level Set of a Pixel Image
is.lpp

Test Whether An Object Is A Point Pattern on a Linear Network
mergeLevels

Merge Levels of a Factor
lut

Lookup Tables
methods.funxy

Methods for Spatial Functions
markstat

Summarise Marks in Every Neighbourhood in a Point Pattern
nearestsegment

Find Line Segment Nearest to Each Point
nearestValue

Image of Nearest Defined Pixel Value
metric.object

Distance Metric
midpoints.psp

Midpoints of Line Segment Pattern
maxnndist

Compute Minimum or Maximum Nearest-Neighbour Distance
matchingdist

Distance for a Point Pattern Matching
methods.layered

Methods for Layered Objects
methods.pp3

Methods for three-dimensional point patterns
nearest.raster.point

Find Pixel Nearest to a Given Point
methods.boxx

Methods for Multi-Dimensional Box
methods.ppx

Methods for Multidimensional Space-Time Point Patterns
methods.box3

Methods for Three-Dimensional Box
multiplicity.ppp

Count Multiplicity of Duplicate Points
methods.unitname

Methods for Units
nnmap

K-th Nearest Point Map
nnfun

Nearest Neighbour Index Map as a Function
nncross.pp3

Nearest Neighbours Between Two Patterns in 3D
nncross

Nearest Neighbours Between Two Patterns
nndist

Nearest neighbour distances
nndist.psp

Nearest neighbour distances between line segments
nncross.ppx

Nearest Neighbours Between Two Patterns in Any Dimensions
nndist.pp3

Nearest neighbour distances in three dimensions
nndist.ppx

Nearest Neighbour Distances in Any Dimensions
nestsplit

Nested Split
nnmark

Mark of Nearest Neighbour
nobjects

Count Number of Geometrical Objects in a Spatial Dataset
opening

Morphological Opening
nvertices

Count Number of Vertices
nnwhich.pp3

Nearest neighbours in three dimensions
nnwhich

Nearest neighbour
npoints

Number of Points in a Point Pattern
nnwhich.ppx

Nearest Neighbours in Any Dimensions
overlap.owin

Compute Area of Overlap
nsegments

Number of Line Segments in a Line Segment Pattern
pairdist.ppx

Pairwise Distances in Any Dimensions
pairdist.pp3

Pairwise distances in Three Dimensions
pairdist.ppp

Pairwise distances
padimage

Pad the Border of a Pixel Image
owin

Create a Window
owin2mask

Convert Window to Binary Mask under Constraints
pHcolourmap

Colour Map for pH Values
pairdist

Pairwise distances
owin.object

Class owin
pairdist.default

Pairwise distances
pairdist.psp

Pairwise distances between line segments
pixelcentres

Extract Pixel Centres as Point Pattern
persp.ppp

Perspective Plot of Marked Point Pattern
perspPoints

Draw Points or Lines on a Surface Viewed in Perspective
periodify

Make Periodic Copies of a Spatial Pattern
perimeter

Perimeter Length of Window
pixellate.owin

Convert Window to Pixel Image
pixellate.ppp

Convert Point Pattern to Pixel Image
persp.im

Perspective Plot of Pixel Image
pixellate

Convert Spatial Object to Pixel Image
plot.onearrow

Plot an Arrow
plot.im

Plot a Pixel Image
plot.listof

Plot a List of Things
plot.layered

Layered Plot
pixelquad

Quadrature Scheme Based on Pixel Grid
plot.anylist

Plot a List of Things
plot.imlist

Plot a List of Images
plot.hyperframe

Plot Entries in a Hyperframe
plot.colourmap

Plot a Colour Map
pixellate.psp

Convert Line Segment Pattern to Pixel Image
plot.quad

Plot a Spatial Quadrature Scheme
plot.psp

plot a Spatial Line Segment Pattern
plot.owin

Plot a Spatial Window
plot.pppmatching

Plot a Point Matching
plot.pp3

Plot a Three-Dimensional Point Pattern
plot.symbolmap

Plot a Graphics Symbol Map
plot.quadratcount

Plot Quadrat Counts
plot.splitppp

Plot a List of Point Patterns
plot.ppp

plot a Spatial Point Pattern
plot.solist

Plot a List of Spatial Objects
pp3

Three Dimensional Point Pattern
plot.yardstick

Plot a Yardstick or Scale Bar
pppdist

Distance Between Two Point Patterns
ppp.object

Class of Point Patterns
pointsOnLines

Place Points Evenly Along Specified Lines
plot.tess

Plot a Tessellation
plot.texturemap

Plot a Texture Map
ppp

Create a Point Pattern
polartess

Tessellation Using Polar Coordinates
plot.textstring

Plot a Text String
progressreport

Print Progress Reports
print.owin

Print Brief Details of a Spatial Window
print.ppp

Print Brief Details of a Point Pattern Dataset
pppmatching

Create a Point Matching
print.quad

Print a Quadrature Scheme
project2segment

Move Point To Nearest Line
print.psp

Print Brief Details of a Line Segment Pattern Dataset
ppx

Multidimensional Space-Time Point Pattern
print.im

Print Brief Details of an Image
pppmatching.object

Class of Point Matchings
quad.object

Class of Quadrature Schemes
quadratcount

Quadrat counting for a point pattern
quadscheme.logi

Generate a Logistic Regression Quadrature Scheme from a Point Pattern
psp.object

Class of Line Segment Patterns
psp2mask

Convert Line Segment Pattern to Binary Pixel Mask
project2set

Find Nearest Point in a Region
quadrats

Divide Region into Quadrats
quadscheme

Generate a Quadrature Scheme from a Point Pattern
quantess

Quantile Tessellation
psp

Create a Line Segment Pattern
quasirandom

Quasirandom Patterns
requireversion

Require a Specific Version of a Package
relevel.im

Reorder Levels of a Factor-Valued Image or Pattern
quantilefun.im

Quantile Function for Images
quantile.im

Sample Quantiles of Pixel Image
reflect

Reflect In Origin
rQuasi

Generate Quasirandom Point Pattern in Given Window
regularpolygon

Create A Regular Polygon
rescale.psp

Convert Line Segment Pattern to Another Unit of Length
rectdistmap

Distance Map Using Rectangular Distance Metric
rescale.owin

Convert Window to Another Unit of Length
rexplode

Explode a Point Pattern by Displacing Duplicated Points
rescale.im

Convert Pixel Image to Another Unit of Length
rgbim

Create Colour-Valued Pixel Image
raster.x

Cartesian Coordinates for a Pixel Raster
rescale

Convert dataset to another unit of length
restrict.colourmap

Restrict a Colour Map to a Subset of Values
rescue.rectangle

Convert Window Back To Rectangle
rescale.ppp

Convert Point Pattern to Another Unit of Length
round.ppp

Apply Numerical Rounding to Spatial Coordinates
rotate.im

Rotate a Pixel Image
rotate.infline

Rotate or Shift Infinite Lines
rotate.owin

Rotate a Window
rotate.psp

Rotate a Line Segment Pattern
rotate.ppp

Rotate a Point Pattern
rotate

Rotate
rlinegrid

Generate grid of parallel lines with random displacement
rjitter

Random Perturbation of a Point Pattern
rev.colourmap

Reverse the Colours in a Colour Map
ripras

Estimate window from points alone
selfcrossing.psp

Crossing Points in a Line Segment Pattern
scanpp

Read Point Pattern From Data File
scaletointerval

Rescale Data to Lie Between Specified Limits
scalardilate

Apply Scalar Dilation
rounding.ppp

Detect Numerical Rounding
selfcut.psp

Cut Line Segments Where They Intersect
rsyst

Simulate systematic random point pattern
sessionLibs

Print Names and Version Numbers of Libraries Loaded
shift.owin

Apply Vector Translation To Window
shift.im

Apply Vector Translation To Pixel Image
sidelengths.owin

Side Lengths of Enclosing Rectangle of a Window
shift.psp

Apply Vector Translation To Line Segment Pattern
simplepanel

Simple Point-and-Click Interface Panels
simplify.owin

Approximate a Window by a Simpler Polygon
runifrect

Generate N Uniform Random Points in a Rectangle
run.simplepanel

Run Point-and-Click Interface
shift

Apply Vector Translation
setcov

Set Covariance of a Window
shift.ppp

Apply Vector Translation To Point Pattern
shift.ppx

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

Evaluate Logical Expression Involving Pixel Images and Return Region Where Expression is True
spatstat.geom-deprecated

Deprecated spatstat.geom functions
spatstat.geom-internal

Internal spatstat.geom functions
spatdim

Spatial Dimension of a Dataset
solist

List of Two-Dimensional Spatial Objects
solapply

Apply a Function Over a List and Obtain a List of Objects
spatstat.options

Internal Options in Spatstat Package
split.hyperframe

Divide Hyperframe Into Subsets and Reassemble
spatstat.geom-package

The spatstat.geom Package
split.im

Divide Image Into Sub-images
summary.distfun

Summarizing a Function of Spatial Location
subset.ppp

Subset of Point Pattern Satisfying A Condition
split.ppx

Divide Multidimensional Point Pattern into Sub-patterns
split.ppp

Divide Point Pattern into Sub-patterns
stratrand

Stratified random point pattern
summary.anylist

Summary of a List of Things
square

Square Window
spokes

Spokes pattern of dummy points
subset.hyperframe

Subset of Hyperframe Satisfying A Condition
subset.psp

Subset of Line Segment Satisfying A Condition
summary.solist

Summary of a List of Spatial Objects
superimpose

Superimpose Several Geometric Patterns
summary.psp

Summary of a Line Segment Pattern Dataset
summary.owin

Summary of a Spatial Window
symbolmap

Graphics Symbol Map
summary.quad

Summarizing a Quadrature Scheme
summary.ppp

Summary of a Point Pattern Dataset
summary.im

Summarizing a Pixel Image
summary.splitppp

Summary of a Split Point Pattern
summary.listof

Summary of a List of Things
tess

Create a Tessellation
textureplot

Plot Image or Tessellation Using Texture Fill
text.ppp

Add Text Labels to Spatial Pattern
test.crossing.psp

Check Whether Segments Cross
tilenames

Names of Tiles in a Tessellation
texturemap

Texture Map
tiles.empty

Check For Empty Tiles in a Tessellation
tiles

Extract List of Tiles in a Tessellation
tileindex

Determine Which Tile Contains Each Given Point
tile.areas

Compute Areas of Tiles in a Tessellation
timeTaken

Extract the Total Computation Time
unique.ppp

Extract Unique Points from a Spatial Point Pattern
union.quad

Union of Data and Dummy Points
tweak.colourmap

Change Colour Values in a Colour Map
unitname

Name for Unit of Length
triangulate.owin

Decompose Window into Triangles
uniquemap.ppp

Map Duplicate Entries to Unique Entries
transmat

Convert Pixel Array Between Different Conventions
timed

Record the Computation Time
trim.rectangle

Cut margins from rectangle
whichhalfplane

Test Which Side of Infinite Line a Point Falls On
venn.tess

Tessellation Delimited by Several Sets
volume

Volume of an Object
with.hyperframe

Evaluate an Expression in Each Row of a Hyperframe
unstack.ppp

Separate Multiple Columns of Marks
unstack.solist

Unstack Each Spatial Object in a List of Objects
unmark

Remove Marks
where.max

Find Location of Maximum in a Pixel Image
vertices

Vertices of a Window
yardstick

Text, Arrow or Scale Bar in a Diagram
zapsmall.im

Rounding of Pixel Values
update.symbolmap

Update a Graphics Symbol Map.