/usr/include/terralib/kernel/TeSpatialOperations.h is in libterralib-dev 4.3.0+dfsg.2-10.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 | /************************************************************************************
TerraLib - a library for developing GIS applications.
Copyright © 2001-2007 INPE and Tecgraf/PUC-Rio.
This code is part of the TerraLib library.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
You should have received a copy of the GNU Lesser General Public
License along with this library.
The authors reassure the license terms regarding the warranties.
They specifically disclaim any warranties, including, but not limited to,
the implied warranties of merchantability and fitness for a particular purpose.
The library provided hereunder is on an "as is" basis, and the authors have no
obligation to provide maintenance, support, updates, enhancements, or modifications.
In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
indirect, special, incidental, or consequential damages arising out of the use
of this library and its documentation.
*************************************************************************************/
/*! \file TeSpatialOperations.h
\brief This file contains functions to spatial operations with geographical objects that are in a SGBD
*/
#ifndef __TERRALIB_INTERNAL_SPATIALOPERATIONS_H
#define __TERRALIB_INTERNAL_SPATIALOPERATIONS_H
#include "TeDatabase.h"
#include "TeRaster.h"
//! Keep the selected geometries in the canvas
typedef vector<TeGeometry*> TeSelectedGeom;
//! Return a string with the identifications of the selected geometries
TL_DLL string getStringIds(TeKeys& IdsIn);
//! Return a portal with the geometries of a spatial table that have a topological relation with specifics geometries of this spatial table
/*!
Calculate the topological relation between all geometries of a spatial table and
specifics geometries of this spatial table
\param actGeomTable spatial table name that contains all the geometries
\param actRep geometrical representation of the spatial table
\param actIdsIn identifications of the specifics geometries (object_id)
\param portal returned with the resultants geometries
\param relation topological relation that will be computed
\param actColTable collection table name that contains a set of geometries of the spatial table
*/
TL_DLL bool TeTopologicalRelation(const string& actGeomTable, TeGeomRep actRep, TeKeys& actIdsIn,
TeDatabasePortal *portal, int relation, const string& actColTable="");
//! Return a portal with the geometries of a spatial table that have a topological relation with specifics geometries of other spatial table
/*!
Calculate the topological relation between all geometries of a spatial table and
specifics geometries of other spatial table
\param actGeomTable first spatial table name that contains the specifics geometries
\param actRep geometrical representation of the first spatial table
\param actIdsIn identifications of specifics geometries of the first spatial table (object_id)
\param visGeomTable second spatial table name that contains the others geometries
\param visRep geometrical representation of the second spatial table
\param portal returned with the resultants geometries
\param relation topological relation that will be computed
\param visColTable collection table name that contains a set of geometries of the second spatial table
*/
TL_DLL bool TeTopologicalRelation(const string& actGeomTable, TeGeomRep actRep, TeKeys& actIdsIn,
const string& visGeomTable, TeGeomRep visRep, TeDatabasePortal *portal,
int relation, const string& visColTable="");
//! Return a portal with the geometries of a spatial table that have a topological relation with a specific geometry
/*!
Calculate the topological relation between all geometries of a spatial table and a specific geometry
\param actGeomTable spatial table name that contains the geometries
\param actRep geometrical representation of the spatial table
\param geom a specific geometry
\param portal returned with the resultants geometries
\param relation topological relation that will be computed
\param actCollTable collection table name that contains a set of geometries of the spatial table
*/
TL_DLL bool TeTopologicalRelation(const string& actGeomTable, TeGeomRep actRep, TeGeometry* geom,
TeDatabasePortal *portal, int relation, const string& actCollTable="");
//! Return the identications of the geometries of a spatial table that have a topological relation with specifics geometries of this spatial table
/*!
Calculate the topological relation between all geometries of a spatial table and
specifics geometries of this spatial table
\param actGeomTable spatial table name that contains all the geometries
\param actRep geometrical representation of the spatial table
\param actIdsIn identifications of the specifics geometries (object_id)
\param actIdsOut returned with the identications of the resultants geometries (object_id)
\param db a TeDatabase pointer
\param relation topological relation that will be computed
\param actCollTable collection table name that contains a set of geometries of the spatial table
*/
TL_DLL bool TeTopologicalRelation(const string& actGeomTable, TeGeomRep actRep, TeKeys& actIdsIn,
TeKeys& actIdsOut, TeDatabase* db, int relation, const string& actCollTable="");
//! Return the identications of the geometries of a spatial table that have a topological relation with specifics geometries of other spatial table
/*!
Calculate the topological relation between all geometries of a spatial table and
specifics geometries of other spatial table
\param actGeomTable first spatial table name that contains the specifics geometries
\param actRep geometrical representation of the first spatial table
\param actIdsIn identifications of specifics geometries of the first spatial table (object_id)
\param visGeomTable second spatial table name that contains the others geometries
\param visRep geometrical representation of the second spatial table
\param visIdsOut returned with the identications of the resultants geometries (object_id)
\param db a TeDatabase pointer
\param relation topological relation that will be computed
\param visCollTable collection table name that contains a set of geometries of the second spatial table
*/
TL_DLL bool TeTopologicalRelation(const string& actGeomTable, TeGeomRep actRep, TeKeys& actIdsIn,
const string& visGeomTable, TeGeomRep visRep, TeKeys& visIdsOut,
TeDatabase* db, int relation, const string& visCollTable="", TeDatabase* = 0);
//! Return the identications of the geometries of a spatial table that have a topological relation with a specific geometry
/*!
Calculate the topological relation between all geometries of a spatial table and a specific geometry
\param actGeomTable spatial table name that contains the geometries
\param actRep geometrical representation of the spatial table
\param geom a specific geometry
\param actIdsOut returned with the identications of the resultants geometries (object_id)
\param db a TeDatabase pointer
\param relation topological relation that will be computed
\param actCollTable collection table name that contains a set of geometries of the spatial table
*/
TL_DLL bool TeTopologicalRelation(const string& actGeomTable, TeGeomRep actRep, TeGeometry* geom,
TeKeys& actIdsOut, TeDatabase* db, int relation, const string& actCollTable="");
//! Return whether the specified topological relation holds between two polygon
/*!
\param geom1 a polygon
\param geom2 another polygon
\param relation topological relation to be verified
*/
TL_DLL bool TeTopologicalRelation(const TePolygon* geom1, const TePolygon* geom2, int relation);
//! Return whether the specified topological relation holds between a polygon and a line
/*!
\param geom1 a polygon
\param geom2 a line
\param relation topological relation to be verified
*/
TL_DLL bool TeTopologicalRelation(const TePolygon* geom1, const TeLine2D* geom2, int relation);
//! Return whether the specified topological relation holds between a polygon and a point
/*!
\param geom1 a polygon
\param geom2 a point
\param relation topological relation to be verified
*/
TL_DLL bool TeTopologicalRelation(const TePolygon* geom1, const TePoint* geom2, int relation);
//! Return whether the specified topological relation holds between two lines
/*!
\param geom1 a line
\param geom2 another line
\param relation topological relation to be verified
*/
TL_DLL bool TeTopologicalRelation(const TeLine2D* geom1, const TeLine2D* geom2, int relation);
//! Return whether the specified topological relation holds between a line and a point
/*!
\param geom1 a line
\param geom2 a point
\param relation topological relation to be verified
*/
TL_DLL bool TeTopologicalRelation(const TeLine2D* geom1, const TePoint* geom2, int relation);
//! Return whether the specified topological relation holds between two points
/*!
\param geom1 a point
\param geom2 another point
\param relation topological relation to be verified
*/
TL_DLL bool TeTopologicalRelation(const TePoint* geom1, const TePoint* geom2, int relation);
//! Return whether the specified topological relation holds between two cells
/*!
\param geom1 a cell
\param geom2 another cell
\param relation topological relation to be verified
*/
TL_DLL bool TeTopologicalRelation(const TeCell* geom1, const TeCell* geom2, int relation);
//! Return whether the specified topological relation holds between a cell and a polygon
/*!
\param geom1 a cell
\param geom2 a polygon
\param relation topological relation to be verified
*/
TL_DLL bool TeTopologicalRelation(const TeCell* geom1, const TePolygon* geom2, int relation);
//! Return whether the specified topological relation holds between a cell and a line
/*!
\param geom1 a cell
\param geom2 a line
\param relation topological relation to be verified
*/
TL_DLL bool TeTopologicalRelation(const TeCell* geom1, const TeLine2D* geom2, int relation);
//! Return whether the specified topological relation holds between a cell and a point
/*!
\param geom1 a cell
\param geom2 a point
\param relation topological relation to be verified
*/
TL_DLL bool TeTopologicalRelation(const TeCell* geom1, const TePoint* geom2, int relation);
//! Returns the geometries of a geometric table (actGeomTable) that are within a specific distance from a point in memory
/*!
\param actGeomTable geometric table name
\param actRep geometric representation of the actGeomTable table
\param point a point in memory
\param IdsDistOut structure that will contain the identifiers of the resulted geometries and their distances
\param db a TeDatabase pointer
\param max_dist maximum distance
\param actCollTable collection table name associated with the actGeomTable table
*/
TL_DLL bool TeGetWithinDistance(const string& actGeomTable, TeGeomRep actRep, const TeCoord2D& point, TeKeysToDist& IdsDistOut,
TeDatabase* db, const double& max_dist, const string& actCollTable="");
//! Return the area of some specifics geometries of a spatial table
/*!
\param actGeomTable spatial table name that contains the geometries
\param actRep geometrical representation of the spatial table
\param actIdsIn identifications of the specifics geometries (object_id)
\param db a TeDatabase pointer
\param area area returned
*/
TL_DLL bool TeGetArea(const string& actGeomTable, TeGeomRep actRep, TeKeys& actIdsIn, TeDatabase* db, double& area);
//! Return the length of some specifics geometries of a spatial table
TL_DLL bool TeGetLength(const string& actGeomTable, TeGeomRep actRep, TeKeys& actIdsIn, TeDatabase* db, double& length);
//! Return the distance between two geometries
TL_DLL bool TeGetDistance(const string& actGeomTable, TeGeomRep actRep, TeKeys& IdsIn, TeDatabase* db, double& distance);
//! Return the convexhull geometries of specifics geometries of a spatial table
/*!
\param actGeomTable spatial table name that contains the geometries
\param actRep geometrical representation of the spatial table
\param actIds identifications of the specifics geometries (object_id)
\param db a TeDatabase pointer
\param convexHullSet the convexhull geometries returned
*/
TL_DLL bool TeGetConvexHull(const string& actGeomTable, TeGeomRep actRep, TeKeys& actIds, TeDatabase* db,
TePolygonSet& convexHullSet);
//! Return the centroids of specifics geometries of a spatial table
TL_DLL bool TeGetCentroid(const string& actGeomTable, TeGeomRep actRep, TeDatabase* db, TePointSet& centroidSet,
TeKeys& actIds, const string& actCollTable="");
//! Return the buffer
TL_DLL bool TeGetBuffer(const string& actGeomTable, TeGeomRep actRep, TeKeys& actIds, TeDatabase* db,
TePolygonSet& bufferSet, double dist);
//! Return intersection
TL_DLL bool TeGetOverlay(const string& actGeomTable, TeGeomRep actRep, TeKeys& actIds, TeDatabase* db,
TeGeometryVect& geomVect, const short& operation);
/*!
\brief Clip a raster from a polygon. Return the clipped raster
\param rasterIn TeRaster pointer that will be clipped
\param poly polygon that defines the clipping
\param st strategic to the iterator of the raster
*/
TL_DLL TeRaster*
TeMask (TeRaster* rasterIn, TePolygon& poly, TeStrategicIterator st);
#endif
|