LCOV - code coverage report
Current view: top level - core/geocoding - qgsgeocodercontext.h (source / functions) Hit Total Coverage
Test: coverage.info.cleaned Lines: 0 6 0.0 %
Date: 2021-03-26 12:19:53 Functions: 0 0 -
Branches: 0 0 -

           Branch data     Line data    Source code
       1                 :            : /***************************************************************************
       2                 :            :   qgsgeocodercontext.h
       3                 :            :   ---------------
       4                 :            :   Date                 : August 2020
       5                 :            :   Copyright            : (C) 2020 by Nyall Dawson
       6                 :            :   Email                : nyall dot dawson at gmail dot com
       7                 :            :  ***************************************************************************
       8                 :            :  *                                                                         *
       9                 :            :  *   This program is free software; you can redistribute it and/or modify  *
      10                 :            :  *   it under the terms of the GNU General Public License as published by  *
      11                 :            :  *   the Free Software Foundation; either version 2 of the License, or     *
      12                 :            :  *   (at your option) any later version.                                   *
      13                 :            :  *                                                                         *
      14                 :            :  ***************************************************************************/
      15                 :            : 
      16                 :            : #ifndef QGSGEOCODERCONTEXT_H
      17                 :            : #define QGSGEOCODERCONTEXT_H
      18                 :            : 
      19                 :            : #include "qgis_core.h"
      20                 :            : 
      21                 :            : #include "qgscoordinatetransformcontext.h"
      22                 :            : #include "qgscoordinatereferencesystem.h"
      23                 :            : #include "qgsgeometry.h"
      24                 :            : 
      25                 :            : /**
      26                 :            :  * \ingroup core
      27                 :            :  * \brief Encapsulates the context of a geocoding operation.
      28                 :            :  *
      29                 :            :  * \since QGIS 3.18
      30                 :            : */
      31                 :          0 : class CORE_EXPORT QgsGeocoderContext
      32                 :            : {
      33                 :            : 
      34                 :            :   public:
      35                 :            : 
      36                 :            :     /**
      37                 :            :      * Constructor for QgsGeocoderContext, with the specified \a transformContext.
      38                 :            :      */
      39                 :            :     QgsGeocoderContext( const QgsCoordinateTransformContext &transformContext );
      40                 :            : 
      41                 :            :     /**
      42                 :            :      * Returns the coordinate transform context, which should be used whenever the
      43                 :            :      * geocoder constructs a coordinate transform.
      44                 :            :      *
      45                 :            :      * \see setTransformContext()
      46                 :            :      */
      47                 :          0 :     QgsCoordinateTransformContext transformContext() const { return mTransformContext; }
      48                 :            : 
      49                 :            :     /**
      50                 :            :      * Sets the coordinate transform \a context, which should be used whenever the
      51                 :            :      * geocoder constructs a coordinate transform.
      52                 :            :      *
      53                 :            :      * \see transformContext()
      54                 :            :      */
      55                 :            :     void setTransformContext( const QgsCoordinateTransformContext &context ) { mTransformContext = context; }
      56                 :            : 
      57                 :            :     /**
      58                 :            :      * Returns the optional area of interest, which can be used to indicate the desired
      59                 :            :      * geographic area where geocoding results are desired.
      60                 :            :      *
      61                 :            :      * The area of interest can be a polygon geometry, in which case it represents the extent
      62                 :            :      * to use for filtering candidate results, or a point geometry, in which case it represents
      63                 :            :      * a "target point" for prioritizing closer results.
      64                 :            :      *
      65                 :            :      * The coordinate reference system for the area of interest can be retrieved via
      66                 :            :      * areaOfInterestCrs().
      67                 :            :      *
      68                 :            :      * \see setAreaOfInterest()
      69                 :            :      * \see areaOfInterestCrs()
      70                 :            :      */
      71                 :          0 :     QgsGeometry areaOfInterest() const { return mAreaOfInterest; }
      72                 :            : 
      73                 :            :     /**
      74                 :            :      * Sets the optional \a area of interest, which can be used to indicate the desired
      75                 :            :      * geographic area where geocoding results are desired.
      76                 :            :      *
      77                 :            :      * The area of interest can be a polygon geometry, in which case it represents the extent
      78                 :            :      * to use for filtering candidate results, or a point geometry, in which case it represents
      79                 :            :      * a "target point" for prioritizing closer results.
      80                 :            :      *
      81                 :            :      * The coordinate reference system for the area of interest can be set via
      82                 :            :      * setAreaOfInterestCrs().
      83                 :            :      *
      84                 :            :      * \see areaOfInterest()
      85                 :            :      * \see setAreaOfInterestCrs()
      86                 :            :      */
      87                 :          0 :     void setAreaOfInterest( const QgsGeometry &area ) { mAreaOfInterest = area; }
      88                 :            : 
      89                 :            :     /**
      90                 :            :      * Returns the coordinate reference system for the area of interest, which can be used to indicate the desired
      91                 :            :      * geographic area where geocoding results are desired.
      92                 :            :      *
      93                 :            :      * \see areaOfInterest()
      94                 :            :      * \see setAreaOfInterestCrs()
      95                 :            :      */
      96                 :          0 :     QgsCoordinateReferenceSystem areaOfInterestCrs() const { return mAreaOfInterestCrs; }
      97                 :            : 
      98                 :            :     /**
      99                 :            :      * Sets the \a crs for the area of interest, which can be used to indicate the desired
     100                 :            :      * geographic area where geocoding results are desired.
     101                 :            :      *
     102                 :            :      * \see areaOfInterestCrs()
     103                 :            :      * \see setAreaOfInterest()
     104                 :            :      */
     105                 :          0 :     void setAreaOfInterestCrs( const QgsCoordinateReferenceSystem &crs ) { mAreaOfInterestCrs = crs; }
     106                 :            : 
     107                 :            :   private:
     108                 :            : 
     109                 :            :     QgsCoordinateTransformContext mTransformContext;
     110                 :            :     QgsGeometry mAreaOfInterest;
     111                 :            :     QgsCoordinateReferenceSystem mAreaOfInterestCrs;
     112                 :            : };
     113                 :            : 
     114                 :            : #endif // QGSGEOCODERCONTEXT_H

Generated by: LCOV version 1.14