Movatterモバイル変換


[0]ホーム

URL:


Type:Package
Title:Spatial Temporal Analysis of Moving Polygons
Version:0.3.1
Description:Perform spatial temporal analysis of moving polygons; a longstanding analysis problem in Geographic Information Systems. Facilitates directional analysis, distance analysis, and some other simple functionality for examining spatial-temporal patterns of moving polygons.
URL:https://github.com/jedalong/stampr
Depends:R (≥ 4.0)
License:GPL-3
Imports:sf, spdep, dplyr, graphics, grDevices, rlang, lwgeom,geosphere
RoxygenNote:7.2.3
Encoding:UTF-8
NeedsCompilation:no
Packaged:2024-01-09 16:19:51 UTC; jlong83
Author:Jed LongORCID iD [aut, cre], Colin Robertson [aut]
Maintainer:Jed Long <jed.long@uwo.ca>
Repository:CRAN
Date/Publication:2024-01-09 17:10:02 UTC

stampr: Spatial Temporal Analysis of Moving Polygons

Description

The Packagestampr provides tools for performing spatial temporal analysis of moving polygons.These tools allow the calculation of directional relationships, distance relations, and other basicfunctionality, such as global change metrics. More details about each of these functionscan be found in its help documentation.

Details

stampr's functions utilize thesf objects (as of version 0.3.0) from the packagesf. Polygon relationships are still understudied in the field of geographic information science, but hopefullystampr can provide users with aplatform for new developments and applied research looking at interesting geographical phenomena.

Author(s)

Jed Long and Colin Robertson

References

Robertson, C., Nelson, T., Boots, B., and Wulder, M. (2007) STAMP: Spatial-temporal analysis of moving polygonsJournal of Geographical Systems, 9:207-227.Long, J., Robertson, C., Nelson, T. (2018) stampr: Spatial-Temporal Analysis of Moving Polygons in RJournal of Statistical Software. Code Snippets, 84(1), 1–19.


Hurricane Katrina eye point dataset

Description

A dataset containing points representing the eye of Hurricane Katrina centroid from 21:00 26-AUG-2005 to 21:00 29-AUG-2005. Polygon contours were extracted from the US NOAA H*Wind product, downloadable from:https://www.aoml.noaa.gov/hrd/data_sub/wind.html

Format

Asf object with 33 records of the eye location of Hurricane Katrina, every 3 hrs, from 21:00 25-AUG-2005 to 21:00 29-AUG-2005. The date and time of each polygon is recorded in thecolumnDateTime.

Details

Theeyeshp dataset contains points that were derived from the raw NOAA H*Wind data. The data is included hereto provide a point-data comparison to the data in thekatrina dataset which is polygon data

Examples

data(eyeshp)plot(eyeshp)

Forest Fire dataset

Description

A dataset containing fake forest fire polygons representing the movement of the forest fire from T1 (fire1) to T2 (fire2). The data is provided purely for demonstration purposes.

Format

fire1 — asf object with polygons representing the location of forest fire.

Source

Simulated data

Examples

data(fire1)plot(fire1)data(fire2)plot(fire2)## Not run: library(mapview)mapview(fire1) + mapview(fire2)## End(Not run)

Forest Fire dataset

Description

see fire1

Format

fire2 — asf object


glob.change

Description

The functionglob.change computes a set of three global change metrics for comparisonbetween two polygon sets. These metrics are outlined in Robertson et al. (2007; Table 4).

Usage

glob.change(T1, T2)

Arguments

T1

asf object of polygons from time 1.

T2

asf object of polygons from time 2.

Details

glob.change computes three change metrics, detailed below, that can be used to quantify changesbetween two polygon sets:

NumRatio – ratio between the number of polygons inT2 andT1;

\mathtt{NumRatio} = \frac{\#(T1)}{\#(T2)}


AreaRatio – ratio between the areas of polygons in T2 and T1;

\mathtt{AreaRatio} = \frac{A(T2)}{A(T1)}


AvgAreaRatio – ratio between theAreaRatio andNumRatio;

\mathtt{AvgAreaRatio} = \frac{\mathtt{AreaRatio}}{\mathtt{NumRatio}} = \frac{\frac{A(T2)}{A(T1)}}{\frac{\#(T1)}{\#(T2)}}

Value

Alist object with three elements - Results for theNumRatio,AreaRatio, andAvgAreaRatio metrics.


Hurricane Katrina polygons dataset

Description

A dataset containing polygons representing the movement of Hurricane Katrina from 21:00 26-AUG-2005 to 21:00 29-AUG-2005. Polygon contours were extracted from the US NOAA H*Wind product, downloadable from:https://www.aoml.noaa.gov/hrd/data_sub/wind.html

Format

Asf object with 33 records of of the location of Hurricane Katrina, every 3 hrs, from 21:00 25-AUG-2005 to 21:00 29-AUG-2005. The date and time of each polygon is recorded in thecolumnDateTime.

Details

Thekatrina dataset contains polygons that were derived from the raw NOAA H*Wind data. The 39 mph isotach(contour of equal wind speed) was used to delineate, as a spatial polygon, the extent of Hurricane Katrina at a given time. Polygons were derived at 3 hr intervals; which means there are 33 different time points inthe dataset.

Source

https://www.aoml.noaa.gov/hrd/data_sub/wind.html

References

Powell, M.D., Murillo, S., Dodge, P., Uhlhorn, E., Gamache, J., Cardone, V., Cox, A., Otero, S., Carrasco, N., Annane, B., St. Fleur, R. (2010) Reconstruction of Hurricane Katrina's wind fields for storm surge and wave hindcasting.Ocean Engineering, 37, 26-36.

Powell, M.D., Houston, S.H. (1998) The HMD real-time hurricane wind analysis system.Journal of WindEngineering and Industrial Aerodynamics, 77/78, 53-64.

Examples

data(katrina)plot(katrina['Id'])

MPB dataset

Description

A dataset containing polygons representing the location of mountain pine beetle hotspot polygons in Morice Forest District, British Columbia, Canada.

Format

mpb — asf object with 711 mountain pine beetle hotspot polygons that occurred over eight years. The temporal indicator is theTGROUP column. Another variableREGION indicates whether the hotspot was in the northern or southern regions, which experienced mostly independent outbreaks.

Details

These data were derived from helicopter-based GPS surveys during early years of large mountain pine beetle outbreak in Western Canada.

Source

Data obtained from Trisalyn Nelson (ASU)

References

Nelson TA, Boots B, Wulder MA, Carroll AL. Environmental characteristics of mountain pine beetle infestation hot spots.Journal of Ecosystems and Management. 2007 Mar 14;8(1).

Examples

data(mpb)plot(mpb['TGROUP'])

Spatial temporal analysis of moving polygons

Description

This function generates asf polygons object that can be used for spatial temporal analysis of moving polygonsas described in the paper Robertson et al. (2007).

Usage

stamp(T1, T2, dc = 0, direction = FALSE, distance = FALSE, ...)

Arguments

T1

asf polygons object of polygons from time 1.

T2

asf polygons object of polygons from time 2.

dc

spatial distance threshold for determining groupings (seeDetails) in appropriate units.

direction

logical, whether or not to perform directional analysis. See documentation forstamp.direction for further details.

distance

logical, whether or not to perform distance analysis. See documentation forstamp.distance for further details.

...

additional parameters to be passed to functions ifdirection, ordistance areset toTRUE.

Details

Thestamp function can be used to perform spatial temporal analysis of moving polygons (STAMP)as outlined in the paper by Robertson et al., (2007). Polygon movement "groups" are delineated based onpolygon connectedness defined by the distance thresholddc. That is, if polygonboundaries (in T1 or T2) are within distancedc of one another they will be designatedto the same group. STAMP events are reported at four levels of increasing complexity:
LEV1 – disappearance (DISA), stable (STBL), and generation (GENA);
LEV2 – disappearance (DISA), contraction (CONT), stable (STBL),expansion (EXPN), and generation (GENR);
LEV3 – disappearance (DISA), T1 displacement (DISP1), convergence (CONV),concentration (CONC), contraction (CONT), stable (STBL),expansion (EXP), fragmentation (FRAG), divergence (DIV),T2 displacement (DISP2), and generation (GENR);
LEV4 – LEV4 is different from other levels. It is used to identify those groups whereunion (UNION), division (DIVISION), and both union and division(BOTH) events occur. These events occur when there are more than onestable event in a group. Groups with one or no stable events receive anNAvalue for LEV4.
See Robertson et al. (2007; especially Figure 1) for complete descriptions of all STAMP movementevent types.

Note also that there must be a unique ID of each polygon, the function uses the row.names of the polygon objects. Modify the row.names accordingly if you wish to use an alternative ID label.

Value

This function returns asf polygons object with the following data columns:

ID1

Polygon ID from T1 polygons;NA if it did not exist,

ID2

Polygon ID from T2 polygons;NA if it did not exist,

LEV1

Level 1 STAMP designation,

LEV2

Level 2 STAMP designation,

LEV3

Level 3 STAMP designation,

LEV4

Level 4 STAMP designation,

GROUP

Group ID signifying group membership,

AREA

Polygon area in appropriate areal units,

--

(optional) Additional columns from directional analysis ifdirection = TRUE,

--

(optional) Additional columns from distance analysis ifdistance = TRUE,

References

Robertson, C., Nelson, T., Boots, B., and Wulder, M. (2007) STAMP: Spatial-temporal analysis of moving polygons.Journal of Geographical Systems, 9:207-227.

See Also

stamp.direction stamp.distance stamp.map stamp.group.summary


Perform polygon directional analysis

Description

stamp.direction facilitates polygon directional analysis using a variety of methods.

Usage

stamp.direction(stmp, dir.mode = "CentroidAngle", ndir = 4, group = FALSE)

Arguments

stmp

asf object generated from thestamp function.

dir.mode

a character item identifying which directional relations method is to be used. SeeDetailsfor information on each individual method.

ndir

(optional) parameter identifying the number of directions to be computed. See individual methodDetails for appropriate usage.

group

(optional) a logical value identifying whether direction should be computed on groups or individualevent polygons (only used withCentroidAngle method).

Details

Thestamp.direction function can be used to facilitate directional analysis on outputstamp.obj objects from functionstamp. Currently, four directional analysis methodsare available:

As of V 0.3 all operations are conducted using sf object classes, all directional (azimuth) and area calculations use WGS84.

Value

Appends the inputstamp object with appropriate columns for the directional analysis chosen, ifdir.mode is:

"CentroidAngle"

A single column with centroid angle results, in degrees (North = 0 degrees). Ifgroup=TRUE then values are identical for all event polygons in the group.

"ConeModel"

ndir new columns with the area (m2) of the STAMP event in each direction,named appropriately (e.g., asDIR45, where 45 refers to the mid-point of that directional cone).

"MBRModel"

9 new columns with the area (m2) of the STAMP event in each direction,named appropriately as, for example, "MBR_SW","MBR_S",... etc.

"ModConeModel"

ndir new columns with the area (m2) of the STAMP event in each direction,named appropriately as, for example, "MC4_N","MC8_SE", ... etc.

Note: STAMP events that are singular (i.e., only 1 polygon in the group)will haveNA's from directional analysis.

References

Robertson, C., Nelson, T., Boots, B., and Wulder, M. (2007) STAMP: Spatial-temporal analysis of moving polygons.Journal of Geographical Systems, 9:207-227.

Peuquet, D., Zhang, C.X. (1987) An algorithm to determine the directional relationship between arbitrarily-shapedpolygons in the plane.Pattern Recognition, 20:65-74.

Skiadopoulos, S. Giannoukos, C., Sarkas, N., Vassiliadis, P., Sellis, T., and Koubarakis, M. (2005) Computing andmanaging directional relations.IEEE Transactions on Knowledge and Data Engineering, 17:1610-1623.

See Also

stamp stamp.distance


stamp.distance

Description

The functionstamp.distance can be used to compute various measures of distance between polygon events and groups. In turn, distance measurements can be used to estimate the velocityof polygon movement.

Usage

stamp.distance(stmp, dist.mode = "Centroid", group = FALSE)

Arguments

stmp

asf object generated from thestamp function.

dist.mode

Character determining the method by which polygon distances are computed. If"Centroid"then the centroid distance is calculated, if"Hausdorff" then the discrete Hausdorff distanceis calculated; seeDetails.

group

logical indicating whether distances should be computed from the T1 polygon to each individual stamp event (group = FALSE – the default), or whether T2 polygons should combined (through a spatial union) in order to compute the measure of distance for each stamp group (group = TRUE)

Details

stamp.distance computes distance between polygon sets based on either centroid orHausdorff distance calculations. Centroid distance is simply the distance from the centroidof all T1 polygons (combined) to each stamp event (group = FALSE), or to the union ofall T2 polygons within a group (group = TRUE), in the second case, all events within a groupare given an identical distance value.

The Hausdorff distance calculation uses the Hausdorff distance, asprogrammed in the functionst_distance. A value ofpar = 0.1 is usedto increase the precision of this measurement – seehelp(st_distance). The returned distanceis then the Hausdorff distance of all T1 polygons (combined) to each stamp event (group = FALSE),or to the union of all T2 polygons within a group (group = TRUE), in the second case, all events within a group are given an identical distance value.All distance calculations are computed in meters using the geographical projection WGS84.

Value

Appropriately named columns (e.g.,CENDIST orHAUSDIST) in the stampsfobject. Distances are in meters.

References

Hausdorff Distance:https://en.wikipedia.org/wiki/Hausdorff_distance

See Also

stamp stamp.direction


Compile stamp summary statistics by group

Description

The functionstamp.group.summary compiles summary statistics for each STAMP grouping.Specifically, it computes the area of each STAMP event type (e.g., generation, expansion, etc.)within each grouping. It also computes the number of events belonging to each event type.

Usage

stamp.group.summary(stmp, area = TRUE, count = TRUE)

Arguments

stmp

asf object generated from thestamp function.

area

logical, whether or not to compute the STAMP event areas.

count

logical, whether or not to compute the count of STAMP events within each group.

Details

stamp.group.summary computes area and count summary statistics of STAMP output. Note that ifbotharea andcount are set toFALSE,stamp.group.summary returns adata.frame with just the group IDs as the only column.

Value

Adata.frame where rows are stamp groups and columns correspond to the STAMP event types (ID, areas, and counts).


Mapping (plotting) functionality forstamp output

Description

This function maps STAMP output for visual assessment of STAMP events and groupings.Choice of which aspect of the stamp output to be visualized is controlled by passingthe column name to thestamp.map function.

Usage

stamp.map(stmp, by = "LEV1", ...)

Arguments

stmp

output from thestamp function, i.e., a (sf object).

by

tells the function which attribute to visualize, one of"LEV1","LEV2","LEV3","LEV4", or"GROUP"

...

additional parameters to be passed to the sf plot function

Details

Thestamp.map function can be used to visualize any of the stamp event designation levels(e.g.,"LEV1","LEV2","LEV3","LEV4", or the STAMP groupings(based off of parameterdc in thestamp function).

Value

stamp.map returns a map of thestamp output using theplot.sf functionality. It implements a pre-defined coloring scheme.

See Also

stampdata("fire1")data("fire2")ch <- stamp(fire1, fire2, dc=1, direction=FALSE, distance=FALSE)stamp.map(ch, "LEV1") stamp.map(ch, "LEV2") stamp.map(ch, "LEV3") stamp.map(ch, "LEV4")


run stamp function for multiple years of polygons at once

Description

The functionstamp.multichange is a wrapper function that makes multiple calls to the stamp function to ease spatial-temporal analysis of multiple years of polygon data

Usage

stamp.multichange(polys, changeByRow = TRUE, changeField = "", ...)

Arguments

polys

asf polygon object with 2+ years of data to run through thestamp function.

changeByRow

logical, whether or not each time period is a separate unique row of data (e.g., as per thekatrina data)

changeField

string, name of the field which contains time period if changeByRow is FALSE

...

list of paramater values to provide to thestamp function

Details

stamp.multichange is a simple wrapper function for thestamp function. The two options for data structureare those in thekatrina data, where each time period is a row, and rows are time-ordered, and the structure of thempb data, where time period is specified by a column. Time periods should be ordered from 1 through T.

Value

Asf object which includes all outputs from the calls to thestamp function. If there are T time periods,there will be T-1 time periods in the resultingsf object.

See Also

stamp.stgroup.summary

Examples

## Not run: ## NOT RUN ##data("katrina")ch <- stamp.multichange(katrina, changeByRow = TRUE, dc = 0, distance = TRUE, direction = FALSE)STGroup <- stamp.stgroup.summary(ch)head(STGroup)## End(Not run)

Compile stamp summary statistics by space-time group

Description

The functionstamp.stgroup.summary compiles summary statistics for each STAMP space-time grouping.Specifically, it computes the area of each STAMP event type (e.g., generation, expansion, etc.)within each grouping. It also computes the number of events belonging to each event type.

Usage

stamp.stgroup.summary(stmp, area = TRUE, count = TRUE)

Arguments

stmp

asf polygon object generated from thestamp.multichange function.

area

logical, whether or not to compute the STAMP event areas.

count

logical, whether or not to compute the count of STAMP events within each group.

Details

stamp.stgroup.summary computes area and count summary statistics of STAMP output derived from multi-time analysis using stamp.multichange.stamp.multichange is just a wrapper function for applying stamp to multiple time periods in the same dataset. Note that ifbotharea andcount are set toFALSE,stamp.stgroup.summary returns adata.frame with just the stgroup IDs as the only column.

Value

Adata.frame where rows are stamp groups and columns correspond to the STAMP event types (ID, areas, and counts).

See Also

stamp.multichange

Examples

## Not run:  ##NOT RUN##library(sf)data("katrina")ch <- stamp.multichange(katrina, changeByRow = TRUE, dc = 0, distance = TRUE, direction = FALSE)STGroup <- stamp.stgroup.summary(ch)head(STGroup)## End(Not run)

[8]ページ先頭

©2009-2025 Movatter.jp