Package edu.gsu.cs.dmlab.interpolation
Class STComplexPolygonInterpolator
- java.lang.Object
-
- edu.gsu.cs.dmlab.interpolation.BaseInterpolation
-
- edu.gsu.cs.dmlab.interpolation.STComplexPolygonInterpolator
-
- All Implemented Interfaces:
IInterpolator
public class STComplexPolygonInterpolator extends BaseInterpolation implements IInterpolator
The method being implemented is from the polygon interpolation methods described in Boubrahimi et. al, 2018.- Author:
- Original Soukaina Filali Boubrahimi, refactored by Dustin Kempton, Data Mining Lab, Georgia State University
-
-
Field Summary
-
Fields inherited from class edu.gsu.cs.dmlab.interpolation.BaseInterpolation
aligner, factory, step
-
-
Constructor Summary
Constructors Constructor Description STComplexPolygonInterpolator(IInterpolationFactory factory, ISeriesAlignmentFactory tsAlignFactory, IInterpolator areaInterpolator, ITemporalAligner aligner, IShapeSeriesAligner tsAligner, IGeometryValidator multipolyValidator, IGeometryValidator simplifyValidator, org.joda.time.Duration step)
Constructor for the Complex Polygon Interpolator method that uses DTW on the shape signature to find an alignment of the input polygons.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected ISTInterpolationEvent
createInterpolatedSTEvent(org.joda.time.DateTime startTime, org.joda.time.DateTime endTime, EventType type, org.locationtech.jts.geom.Coordinate[] i_coordinates)
This method is used to produce and verify the polygon of an event with the input data.ISTInterpolationEvent
interpolateAfterAtTime(ISTInterpolationEvent ev, org.joda.time.DateTime dateTime)
Interpolates a new event report at a specified time using a default movement rate as the method to determine where the input event would be at the given time.ISTInterpolationEvent
interpolateAtTime(ISTInterpolationEvent first, ISTInterpolationEvent second, org.joda.time.DateTime dateTime)
Interpolates a new event report at a specified time.ISTInterpolationEvent
interpolateBeforeAtTime(ISTInterpolationEvent ev, org.joda.time.DateTime dateTime)
Interpolates a new event report at a specified time using a default movement rate as the method to determine where the input event would be at the given time.List<ISTInterpolationEvent>
interpolateBetween(ISTInterpolationEvent first, ISTInterpolationEvent second)
Interpolates new event reports between the two reports that are passed in and returns a list of the interpolated polygon representations.protected List<ISTInterpolationEvent>
interpolateBetweenAlignedNoCopy(ISTInterpolationEvent first, ISTInterpolationEvent second)
This method assumes that the events are already aligned and that it is not supposed to add them to the results.ISTInterpolationTrajectory
interpolateTrajectory(ISTInterpolationTrajectory inTrajectory)
Interpolates new event reports between the reports contained within the input trajectory and returns a new trajectory object with the new data.-
Methods inherited from class edu.gsu.cs.dmlab.interpolation.BaseInterpolation
linearInterpolate, projectEventBack, projectEventForward
-
-
-
-
Constructor Detail
-
STComplexPolygonInterpolator
public STComplexPolygonInterpolator(IInterpolationFactory factory, ISeriesAlignmentFactory tsAlignFactory, IInterpolator areaInterpolator, ITemporalAligner aligner, IShapeSeriesAligner tsAligner, IGeometryValidator multipolyValidator, IGeometryValidator simplifyValidator, org.joda.time.Duration step)
Constructor for the Complex Polygon Interpolator method that uses DTW on the shape signature to find an alignment of the input polygons.- Parameters:
factory
- The factory object used to create new event and trajectory objects that are returned as resultstsAlignFactory
- The factory object used to create various objects used in determining the proper polygon alignmentareaInterpolator
- An interpolation object used when this interpolation object fails to produce an interpolation due to various difficulties encountered while attempting to interpolatealigner
- The temporal aligner that adjusts the start and end time of event reports to be some integer multiple of a step size away from an epochtsAligner
- The series alignment object used to align the shape series of two different polygon objectsmultipolyValidator
- The polygon validator object that cleans up the interpolated polygons, mostly used for complex geometry objects that may contain multiple polygonssimplifyValidator
- A simple polygon validator that is really only used to verify that the points in the polygon are listed in counter clockwise order and are a minimum distance from each other, otherwise they are removed to simplify the polygon inputstep
- The temporal step size between interpolated polygons
-
-
Method Detail
-
interpolateTrajectory
public ISTInterpolationTrajectory interpolateTrajectory(ISTInterpolationTrajectory inTrajectory)
Description copied from class:BaseInterpolation
Interpolates new event reports between the reports contained within the input trajectory and returns a new trajectory object with the new data. The original event reports are copied and temporally aligned with a epoch and a set cadence rate. The original trajectory shall remain unedited.- Specified by:
interpolateTrajectory
in interfaceIInterpolator
- Overrides:
interpolateTrajectory
in classBaseInterpolation
- Parameters:
inTrajectory
- The input trajectory that is to be interpolated.- Returns:
- An interpolated trajectory that is a representation of the input if it had reports at the desired cadence rate.
-
interpolateBetween
public List<ISTInterpolationEvent> interpolateBetween(ISTInterpolationEvent first, ISTInterpolationEvent second)
Description copied from class:BaseInterpolation
Interpolates new event reports between the two reports that are passed in and returns a list of the interpolated polygon representations. The original event reports are copied to be the first and last elements in the returned list. They are also temporally aligned with an epoch and a set cadence rate. The original objects shall remain unedited.- Specified by:
interpolateBetween
in interfaceIInterpolator
- Overrides:
interpolateBetween
in classBaseInterpolation
- Parameters:
first
- The first element to interpolate betweensecond
- The end element to interpolate between- Returns:
- A list of interpolated polygon objects between the two input objects
-
interpolateBeforeAtTime
public ISTInterpolationEvent interpolateBeforeAtTime(ISTInterpolationEvent ev, org.joda.time.DateTime dateTime)
Description copied from interface:IInterpolator
Interpolates a new event report at a specified time using a default movement rate as the method to determine where the input event would be at the given time. The original event is assumed to be at the time period it is supposed to be, and therefore does not have its time stamp adjusted prior to interpolation. The original object remains unmodified and only a new event is returned at the interpolated time.- Specified by:
interpolateBeforeAtTime
in interfaceIInterpolator
- Parameters:
ev
- The event to apply an interpolation method todateTime
- The date and time of the object report to be interpolated. This time must be prior to the date and time of the input event. Otherwise an exception is thrown.- Returns:
- An object that is at an interpolated point prior to the input event.
-
interpolateAfterAtTime
public ISTInterpolationEvent interpolateAfterAtTime(ISTInterpolationEvent ev, org.joda.time.DateTime dateTime)
Description copied from interface:IInterpolator
Interpolates a new event report at a specified time using a default movement rate as the method to determine where the input event would be at the given time. The original event is assumed to be at the time period it is supposed to be, and therefore does not have its time stamp adjusted prior to interpolation. The original object remains unmodified and only a new event is returned at the interpolated time.- Specified by:
interpolateAfterAtTime
in interfaceIInterpolator
- Parameters:
ev
- The event to apply an interpolation method todateTime
- The date and time of the object report to be interpolated. This time must be after the date and time of the input event. Otherwise an exception is thrown.- Returns:
- An object that is at an interpolated point after the input event.
-
interpolateAtTime
public ISTInterpolationEvent interpolateAtTime(ISTInterpolationEvent first, ISTInterpolationEvent second, org.joda.time.DateTime dateTime)
Description copied from interface:IInterpolator
Interpolates a new event report at a specified time. The original event reports are assumed to be at the time period they are supposed to be, and therefore there is not any adjustment made to their time stamp prior to interpolation. The original objects remain unmodified and only a new event is returned at the interpolated time.- Specified by:
interpolateAtTime
in interfaceIInterpolator
- Parameters:
first
- The first element to interpolate betweensecond
- The second element to interpolate betweendateTime
- The date and time of the object report to be interpolated- Returns:
- An object that is at an interpolated point between the inputs
-
interpolateBetweenAlignedNoCopy
protected List<ISTInterpolationEvent> interpolateBetweenAlignedNoCopy(ISTInterpolationEvent first, ISTInterpolationEvent second)
This method assumes that the events are already aligned and that it is not supposed to add them to the results.- Specified by:
interpolateBetweenAlignedNoCopy
in classBaseInterpolation
- Parameters:
first
- The first event to be used for interpolation betweensecond
- The second event to be used for interpolation between- Returns:
- A list of event reports that were created as a
-
createInterpolatedSTEvent
protected ISTInterpolationEvent createInterpolatedSTEvent(org.joda.time.DateTime startTime, org.joda.time.DateTime endTime, EventType type, org.locationtech.jts.geom.Coordinate[] i_coordinates)
Description copied from class:BaseInterpolation
This method is used to produce and verify the polygon of an event with the input data.- Specified by:
createInterpolatedSTEvent
in classBaseInterpolation
- Parameters:
startTime
- The start time of the eventendTime
- The end time of the eventtype
- The type of the eventi_coordinates
- The coordinates of the polygon to use in the event- Returns:
-
-