Ganos

更新时间:
复制 MD 格式

GanosBase is the spatio-temporal engine built into AnalyticDB for PostgreSQL. It provides data types, functions, and stored procedures for storing, indexing, querying, analyzing, and computing spatial and spatio-temporal data against Object Storage Service (OSS).

For an overview of GanosBase, see Overview.

Raster SQL references

Raster creation and import/export

FunctionDescription
ST_CreateRastCreates a raster object backed by OSS.
ST_ImportFromImports an OSS object into the database as a raster object.
ST_ExportToExports a raster object to OSS.

Pyramid operations

FunctionDescription
ST_BuildPyramidBuilds a pyramid for a raster object.
ST_DeletePyramidDeletes the pyramid of a raster object.
ST_BestPyramidLevelReturns the optimal pyramid level for a viewport defined by world space, width, and height.

Coordinate system conversion

FunctionDescription
ST_Rast2WorldCoordConverts pixel coordinates and a pyramid level to world coordinates using an affine transformation.
ST_World2RastCoordConverts world coordinates and a pyramid level to pixel coordinates using the inverse affine transformation.

Pixel value operations

FunctionDescription
ST_ClipDimensionReturns the raster coordinates of a clipped area.
ST_ClipClips a raster object by a geometry or pixel range.
ST_ClipToRastClips a raster object by a geometry and returns the result as a new raster object.
ST_AddZAssigns Z coordinates to a geometry from the corresponding raster band values.
ST_MosaicFromCombines multiple raster objects into a single raster object by mosaic.

DEM operations

FunctionDescription
ST_SlopeReturns the slope of an elevation raster band in degrees.

Raster accessors

FunctionDescription
ST_NameReturns the name of a raster object, or null if no name is set.
ST_RasterIDReturns the UUID of a raster object.
ST_WidthReturns the width of a raster object in pixels. For chunk width, see ST_ChunkWidth.
ST_HeightReturns the height of a raster object in pixels.
ST_NumBandsReturns the number of bands in a raster object.
ST_CellDepthReturns the pixel depth of a raster object. Valid values: 0 (unknown), 1, 2, 4, 8, 16, 32, or 64.
ST_CellTypeReturns the pixel type of a raster object. Valid values: 8BSI, 8BUI, 16BSI, 16BUI, 32BSI, 32BUI, 32BF, or 64BF.
ST_InterleavingTypeReturns the interleaving type of a raster object. Valid values: BSQ, BIL, or BIP.
ST_TopPyramidLevelReturns the highest pyramid level of a raster object.
ST_ExtentReturns the coordinate range of a raster object in '((maxX,maxY),(minX,minY))' format.
ST_ConvexHullReturns the convex hull geometry of a raster object.
ST_EnvelopeReturns the bounding box of a raster object.
ST_SridReturns the spatial reference system identifier (SRID) of a raster object. SRIDs are stored in the spatial_ref_sys table.
ST_ScaleXReturns the pixel width on the X axis in the spatial reference system.
ST_ScaleYReturns the pixel width on the Y axis in the spatial reference system.
ST_SkewXReturns the skew on the X axis in the spatial reference system.
ST_SkewYReturns the skew on the Y axis in the spatial reference system.
ST_UpperLeftXReturns the upper-left X coordinate in the spatial reference system.
ST_UpperLeftYReturns the upper-left Y coordinate in the spatial reference system.
ST_PixelWidthReturns the pixel width in the spatial reference system.
ST_PixelHeightReturns the pixel height in the spatial reference system.
ST_GeoreferenceReturns the georeference information as affine parameters in "A,B,C,D,E,F" text format.
ST_IsGeoreferencedTests whether a raster object is georeferenced. Returns t or f.
ST_XMinReturns the minimum X coordinate of a raster object.
ST_YMinReturns the minimum Y coordinate of a raster object.
ST_XMaxReturns the maximum X coordinate of a raster object.
ST_YMaxReturns the maximum Y coordinate of a raster object.
ST_ChunkHeightReturns the chunk height of a raster object.
ST_ChunkWidthReturns the chunk width of a raster object.
ST_ChunkBandsReturns the number of bands per chunk of a raster object.
ST_MetaDataReturns the metadata of a raster object as JSON.
ST_MetaItemsReturns the custom metadata items of a raster object.
ST_BeginDateTimeReturns the start time of a raster object.
ST_EndDateTimeReturns the end time of a raster object.
ST_DateTimeReturns the time information of a raster object or band.

Band accessors

FunctionDescription
ST_ValueReturns the pixel value of a cell at the specified band, row, and column.
ST_NoDataReturns the predefined NoData value for a band.
ST_ColorTableReturns the color table of a band as JSON.
ST_StatisticsReturns the statistics for a band as JSON.
ST_SummaryStatsReturns statistics computed across a specific band set.
ST_ColorInterpReturns the color interpretation type of a band.
ST_HistogramReturns the histogram of a band in text format, or null if no histogram exists.
ST_BuildHistogramComputes and returns the histogram for a specific band set.
ST_StatsQuantileReturns the quantiles of a raster object from stored statistics.
ST_QuantileReturns the pixel values at specified quantiles for a raster object.
ST_MD5SumReturns the MD5 hash string of a raster object.

Raster setters

FunctionDescription
ST_SetNameSets the name of a raster object.
ST_SetSridSets the SRID of a raster object. SRIDs are stored in the spatial_ref_sys table.
ST_SetScaleSets the pixel widths on the X and Y axes in the spatial reference system.
ST_SetSkewSets the skews on the X and Y axes in the spatial reference system.
ST_SetUpperLeftSets the upper-left X and Y coordinates in the spatial reference system.
ST_SetGeoreferenceSets the georeference information for a raster object.
ST_UnGeoreferenceRemoves the georeference information from a raster object.
ST_SetNoDataSets the NoData value for a specific band.
ST_SetColorTableSets the color table in JSON format for a specific band.
ST_SetColorInterpSets the color interpretation type for a specific band.
ST_SetStatisticsSets the statistics for a specific band.
ST_SetHistogramSets the histogram in JSON format for a specific band.
ST_SetMD5SumSets the MD5 hash string for a raster object.
ST_SetMetaDataSets a metadata item for a raster object or band.
ST_SetBeginDateTimeSets the start time of a raster object.
ST_SetEndDateTimeSets the end time of a raster object.
ST_SetDateTimeSets the start and end time of a raster object, or the time of a specific band.

Operators

OperatorDescription
Equal to (=)Tests whether the UUID of the first raster object equals that of the second.
Greater than (>)Tests whether the UUID of the first raster object is greater than that of the second.
Less than (<)Tests whether the UUID of the first raster object is less than that of the second.
Greater than or equal to (>=)Tests whether the UUID of the first raster object is greater than or equal to that of the second.
Less than or equal to (<=)Tests whether the UUID of the first raster object is less than or equal to that of the second.

Spatial relationship functions

FunctionDescription
ST_IntersectsTests whether two raster objects, or a raster object and a geometry, intersect.
ST_ContainsTests whether the first object completely contains the second.
ST_ContainsProperlyTests whether the first object properly contains the second (no boundary overlap).
ST_CoversTests whether the first object covers the second.
ST_CoveredByTests whether the first object is covered by the second.
ST_DisjointTests whether two objects share no points in common.
ST_overlapsTests whether two objects overlap (each has at least one point not in the other).
ST_TouchesTests whether two objects share at least one boundary point but their interiors do not intersect.
ST_WithinTests whether the first object is completely enclosed within the second.

Auxiliary functions

FunctionDescription
ST_CheckGPUTests whether a GPU is available in the current environment.
ST_AKIdReturns the AccessKey ID used to access a raster object in OSS. Supports batch modification.
ST_SetAccessKeySets the AccessKey pair (ID and secret) used to access a raster object in OSS.
ST_SetAKIdSets the AccessKey ID used to access a raster object in OSS.
ST_SetAKSecretSets the AccessKey secret used to access a raster object in OSS.

Configuration variables

The following session-level variables control raster engine behavior.

VariableDescription
ganos.raster.calculate_md5Controls whether the MD5 hash is calculated and saved to metadata when a raster object is imported.
ganos.raster.md5sum_chunk_sizeSets the per-read cache size (in MB) used during MD5 calculation.
ganos.raster.mosaic_must_same_nodataControls whether all source rasters must share the same NoData value during mosaic. The values of NoData are not changed during the mosaic operation. Setting this to false may change pixel semantics after the mosaic.

SpatialRef SQL references

FunctionDescription
ST_SrEqualTests whether two spatial reference systems are identical.
ST_SrRegRegisters a spatial reference system.
ST_SrFromEsriWktConverts a string from Esri well-known text (WKT) format to Open Geospatial Consortium (OGC) WKT format.

Trajectory SQL references

Geometry constructors

FunctionDescription
ST_makeTrajectoryConstructs a trajectory object.
ST_appendAppends trajectory points or a sub-trajectory to a trajectory object.

Editing and processing

FunctionDescription
ST_CompressCompresses a trajectory by removing points within the Euclidean distance offset threshold.
ST_CompressSEDCompresses a trajectory using the synchronous Euclidean distance (SED) offset threshold.
ST_attrDeduplicateRemoves trajectory points with duplicate attribute field values, retaining the start and end points.
ST_sortSorts trajectory points by timestamp in ascending order.
ST_deviationReturns the deviation of a processed trajectory from the original.

Attribute metadata

FunctionDescription
ST_attrDefinitionReturns the definitions of all attribute fields in a trajectory object.
ST_attrSizeReturns the number of attribute fields in a trajectory object.
ST_attrNameReturns the name of a specific attribute field, or all field names.
ST_attrTypeReturns the data type of an attribute field.
ST_attrLengthReturns the defined length of an attribute field.
ST_attrNullableTests whether an attribute field allows null values.

Event functions

FunctionDescription
ST_addEventAdds an event to a trajectory object.
ST_eventTimesReturns the timestamps of all events in a trajectory object.
ST_eventTimeReturns the timestamp of an event at a specific index.
ST_eventTypesReturns the type IDs of all events in a trajectory object.
ST_eventTypeReturns the type ID of an event at a specific index.

Trajectory attribute functions

FunctionDescription
ST_startTimeReturns the start time of a trajectory object.
ST_endTimeReturns the end time of a trajectory object.
ST_durationReturns the total duration of a trajectory object.
ST_leafTypeReturns the leaf type of a trajectory object.
ST_leafCountReturns the number of trajectory points in a trajectory object.
ST_trajectorySpatialReturns the spatial geometry of a trajectory object.
ST_trajectoryTemporalReturns the timeline of a trajectory object.
ST_trajAttrsReturns the attribute fields of a trajectory object.
ST_samplingIntervalReturns the sampling interval of a trajectory object.
ST_pointAtTimeReturns the spatial position of a trajectory object at a specific time.
ST_timeAtPointReturns the set of times when a trajectory object passes through a specific point.
ST_velocityAtTimeReturns the velocity at a specific time.
ST_accelerationAtTimeReturns the acceleration at a specific time.
ST_timeToDistanceReturns a time-to-distance line chart, with time on the x-axis and Euclidean distance on the y-axis.
ST_timeAtDistanceReturns the time at which a trajectory object has traveled a specific distance from the start point.
ST_cumulativeDistanceAtTimeReturns the cumulative distance traveled from the start point up to a specific time.
ST_timeAtCumulativeDistanceReturns the time at which a trajectory object has covered a specific cumulative distance from the start point.
ST_subTrajectoryReturns the sub-trajectory within a specific time range.
ST_subTrajectorySpatialReturns the spatial geometry of a trajectory within a specific time range.
ST_attrIntMaxReturns the maximum value of an INTEGER attribute field.
ST_attrIntMinReturns the minimum value of an INTEGER attribute field.
ST_attrIntAverageReturns the average value of an INTEGER attribute field.
ST_attrFloatMaxReturns the maximum value of a FLOAT attribute field.
ST_attrFloatMinReturns the minimum value of a FLOAT attribute field.
ST_attrFloatAverageReturns the average value of a FLOAT attribute field.
ST_trajAttrsAsTextReturns all values of a TEXT attribute field as an array.
ST_trajAttrsAsIntegerReturns all values of an INTEGER attribute field as an array.
ST_trajAttrsAsDoubleReturns all values of a DOUBLE attribute field as an array.
ST_trajAttrsAsBoolReturns all values of a BOOLEAN attribute field as an array.
ST_trajAttrsAsTimestampReturns all values of a TIMESTAMP attribute field as an array.
ST_attrIntFilterFilters trajectory points by a fixed value or range of an INTEGER attribute field.
ST_attrFloatFilterFilters trajectory points by a fixed value or range of a FLOAT attribute field.
ST_attrTimestampFilterFilters trajectory points by a fixed value or range of a TIMESTAMP attribute field.
ST_attrNullFilterReturns a trajectory of points where a specific attribute field is null.
ST_attrNotNullFilterReturns a trajectory of points where a specific attribute field is not null.
ST_trajAttrsMeanMaxReturns the maximum average value of an attribute field across time ranges using the MEAN-MAX algorithm.

Bounding box functions

FunctionDescription
ST_MakeBoxReturns the bounding box of an object within a specific time range.
ST_MakeBox{Z|T|2D|2DT|3D|3DT}Builds a bounding box for a specific dimensional configuration.
ST_BoxndfToGeomConverts a bounding box to a geometry object.
ST_Has{xy|z|t}Tests whether a bounding box has the specified dimension(s).
ST_{X|Y|Z|T}MinReturns the minimum value of a bounding box along a specific axis.
ST_{X|Y|Z|T}MaxReturns the maximum value of a bounding box along a specific axis.
ST_ExpandSpatialExpands a bounding box by a given spatial extent.

Bounding box operators

OperatorDescription
INTERSECT operatorsTests whether the bounding box of the left operand intersects that of the right operand along a specific axis.
INCLUDE operatorsTests whether the bounding box of the left operand includes that of the right operand along a specific axis.
INCLUDED operatorsTests whether the bounding box of the left operand is included in that of the right operand along a specific axis.

Spatial relationship functions

FunctionDescription
ST_intersectsTests whether a trajectory and a geometry intersect in space within a specific time range.
ST_equalsTests whether a trajectory and a geometry are spatially equal within a specific time range.
ST_distanceWithinTests whether a trajectory (within a time range) and a geometry are within a given distance of each other.

Spatial processing

FunctionDescription
ST_intersectionReturns a new trajectory representing the intersection of a trajectory (within a time range) and a geometry.
ST_differenceReturns a new trajectory representing the difference between a trajectory (within a time range) and a geometry.

Spatial statistics

FunctionDescription
ST_nearestApproachPointReturns the point on a trajectory nearest to a geometry within a specific time range.
ST_nearestApproachDistanceReturns the minimum distance between a trajectory and a geometry within a specific time range.

Spatio-temporal relationship functions

FunctionDescription
ST_intersectsTests whether two trajectories intersect in space within a specific time range.
ST_equalsTests whether two trajectories are spatially equal within a specific time range.
ST_distanceWithinTests whether two trajectories are within a given distance of each other within a specific time range.
ST_durationWithinTests whether two trajectories intersect at the same spatial point within a specific time range, where the time difference is shorter than a given interval.
ST_{Z|T|2D|2DT|3D|3DT}IntersectsTests whether two objects intersect along a specific axis.
ST_{2D|2DT|3D|3DT}Intersects_IndexLeftTests whether two objects intersect along a specific axis, using the index on the first object's column.
ST_{2D|2DT|3D|3DT}DWithinTests whether the distance between two objects along a specific axis is within a given threshold.
ST_{2D|2DT|3D|3DT}DWithin_IndexLeftTests whether the distance between two objects along a specific axis is within a given threshold, using the index on the first object's column.
ST_{T|2D|2DT|3D|3DT}ContainsTests whether the first object includes the second along a specific axis.
ST_{T|2D|2DT|3D|3DT}WithinTests whether the first object is included in the second along a specific axis.

Spatio-temporal processing

FunctionDescription
ST_intersectionReturns a new trajectory representing the intersection of two trajectories within a specific time range.

Spatio-temporal statistics

FunctionDescription
ST_nearestApproachPointReturns the point on trajectory 1 nearest to trajectory 2 within a specific time range.
ST_nearestApproachDistanceReturns the minimum distance between two trajectories within a specific time range.

Distance measurement

FunctionDescription
ST_lengthReturns the total length of a trajectory object in meters.
ST_euclideanDistanceReturns the Euclidean distance between two trajectories at the same time point.
ST_mdistanceReturns an array of Euclidean distances between two trajectories at the same time point.

Similarity analysis

FunctionDescription
ST_lcsSimilarityReturns the similarity score between two trajectories using the longest common sub-sequence (LCSS) algorithm.
ST_lcsDistanceReturns the distance and time difference between two trajectories based on the LCSS algorithm.
ST_lcsSubDistanceReturns the distance between an LCSS trajectory and its sub-trajectory.

Indexing

Index typeDescription
GiST indexingCreates a GiST index on a column that stores trajectory data.
TrajGiST indexingCreates a TrajGiST index on a column that stores trajectory data. TrajGiST is optimized for spatio-temporal queries.

Configuration variables

VariableDescription
ganos.trajectory.attr_string_lengthSets the default length for STRING attribute fields.