Skip to content
Permalink
Browse files

Add not null option for OSM export

  • Loading branch information
kiselev-dv committed May 4, 2015
1 parent ce18a60 commit 8902a86fe4f508c3586d382a89793f55e97ce4d8
Showing with 3,004 additions and 361 deletions.
  1. +7 −0 cmake/FindGRASS.cmake
  2. +2 −2 python/core/composer/qgscomposermap.sip
  3. +1 −0 python/core/core.sip
  4. +9 −2 python/core/qgsexpression.sip
  5. +41 −22 python/core/qgsfield.sip
  6. +157 −0 python/core/qgsstatisticalsummary.sip
  7. +24 −5 python/core/qgsvectorlayer.sip
  8. +5 −3 python/core/symbology-ng/qgsgraduatedsymbolrendererv2.sip
  9. +1 −1 python/plugins/processing/algs/grass7/Grass7Algorithm.py
  10. +1 −1 python/plugins/processing/algs/qgis/Eliminate.py
  11. +0 −13 resources/function_help/bbox
  12. +3 −3 resources/function_help/{convexHull → convex_hull}
  13. +0 −12 resources/function_help/geomFromGML
  14. +12 −0 resources/function_help/geom_from_gml
  15. +3 −3 resources/function_help/{geomFromWKT → geom_from_wkt}
  16. +3 −3 resources/function_help/{geomToWKT → geom_to_wkt}
  17. +2 −2 resources/function_help/{getFeature → get_feature}
  18. +13 −0 resources/function_help/intersects_bbox
  19. +3 −3 resources/function_help/{$now → now}
  20. +3 −3 resources/function_help/{$pi → pi}
  21. +0 −12 resources/function_help/symDifference
  22. +12 −0 resources/function_help/sym_difference
  23. +3 −3 resources/function_help/{todate → to_date}
  24. +3 −3 resources/function_help/{todatetime → to_datetime}
  25. +3 −3 resources/function_help/{toint → to_int}
  26. +3 −3 resources/function_help/{tointerval → to_interval}
  27. +3 −3 resources/function_help/{toreal → to_real}
  28. +3 −3 resources/function_help/{tostring → to_string}
  29. +3 −3 resources/function_help/{totime → to_time}
  30. +3 −3 resources/function_help/{$uuid → uuid}
  31. +3 −3 resources/function_help/{xat → x_at}
  32. +3 −3 resources/function_help/{xmax → x_max}
  33. +3 −3 resources/function_help/{xmin → x_min}
  34. +3 −3 resources/function_help/{yat → y_at}
  35. +3 −3 resources/function_help/{ymax → y_max}
  36. +3 −3 resources/function_help/{ymin → y_min}
  37. +5 −0 rpm/.gitignore
  38. +142 −0 rpm/buildrpms.sh
  39. +22 −0 rpm/default.cfg
  40. +923 −0 rpm/qgis.spec.template
  41. +28 −0 rpm/sources/qgis-mime.xml
  42. +61 −0 rpm/sources/qgis-server-README.fedora
  43. +28 −0 rpm/sources/qgis-server-httpd.conf
  44. +28 −7 src/analysis/openstreetmap/qgsosmdatabase.cpp
  45. +5 −3 src/analysis/openstreetmap/qgsosmdatabase.h
  46. +14 −3 src/app/openstreetmap/qgsosmexportdialog.cpp
  47. +4 −0 src/app/qgisapp.cpp
  48. +3 −0 src/core/CMakeLists.txt
  49. +45 −29 src/core/qgsexpression.cpp
  50. +13 −3 src/core/qgsexpression.h
  51. +19 −0 src/core/qgsexpressionparser.yy
  52. +139 −48 src/core/qgsfield.cpp
  53. +62 −59 src/core/qgsfield.h
  54. +120 −0 src/core/qgsfield_p.h
  55. +7 −7 src/core/qgsogcutils.cpp
  56. +18 −9 src/core/qgspointlocator.cpp
  57. +1 −1 src/core/qgsproviderregistry.cpp
  58. +177 −0 src/core/qgsstatisticalsummary.cpp
  59. +191 −0 src/core/qgsstatisticalsummary.h
  60. +61 −0 src/core/qgsvectorlayer.cpp
  61. +19 −0 src/core/qgsvectorlayer.h
  62. +6 −37 src/core/symbology-ng/qgsgraduatedsymbolrendererv2.cpp
  63. +3 −2 src/core/symbology-ng/qgsgraduatedsymbolrendererv2.h
  64. +1 −1 src/gui/editorwidgets/qgsrelationreferencewidget.cpp
  65. +2 −0 src/gui/qgsexpressionbuilderwidget.cpp
  66. +2 −2 src/gui/qgsuserinputtoolbar.cpp
  67. +1 −1 src/gui/qgsuserinputtoolbar.h
  68. +4 −0 tests/src/core/CMakeLists.txt
  69. +39 −1 tests/src/core/testqgsexpression.cpp
  70. +151 −0 tests/src/core/testqgsfield.cpp
  71. +129 −0 tests/src/core/testqgsfields.cpp
  72. +3 −3 tests/src/core/testqgsogcutils.cpp
  73. +13 −13 tests/src/core/testqgsscaleexpression.cpp
  74. +123 −0 tests/src/core/testqgsstatisticalsummary.cpp
  75. +48 −0 tests/src/core/testqgsvectorlayer.cpp
@@ -41,7 +41,14 @@ MACRO (CHECK_GRASS G_PREFIX)
MARK_AS_ADVANCED ( GRASS_LIBRARY${GRASS_FIND_VERSION}_${LIB} )

SET(LIB_PATH NOTFOUND)
# FIND_PATH and FIND_LIBRARY normally search standard locations
# before the specified paths. To search non-standard paths first,
# FIND_* is invoked first with specified paths and NO_DEFAULT_PATH
# and then again with no specified paths to search the default
# locations. When an earlier FIND_* succeeds, subsequent FIND_*s
# searching for the same item do nothing.
FIND_LIBRARY(LIB_PATH NAMES grass_${LIB} PATHS ${G_PREFIX}/lib NO_DEFAULT_PATH)
FIND_LIBRARY(LIB_PATH NAMES grass_${LIB} PATHS ${G_PREFIX}/lib)

IF(LIB_PATH)
SET(GRASS_LIBRARY${GRASS_FIND_VERSION}_${LIB} ${LIB_PATH})
@@ -182,7 +182,7 @@ class QgsComposerMap : QgsComposerItem
/**Called when atlas preview is toggled, to force map item to update its extent and redraw
* @deprecated no longer required
*/
void toggleAtlasPreview();
void toggleAtlasPreview() /Deprecated/;

/**Returns a pointer to the current map extent, which is either the original user specified
* extent or the temporary atlas-driven feature extent depending on the current atlas state
@@ -620,7 +620,7 @@ class QgsComposerMap : QgsComposerItem
/** Returns true if the extent is forced to center on the overview
* @deprecated use overview()->centered() or overviews() instead
*/
bool overviewCentered() const;
bool overviewCentered() const /Deprecated/;

/** Set the overview's centering mode
* @deprecated use overview()->setCentered() or overviews() instead
@@ -103,6 +103,7 @@
%Include qgssnapper.sip
%Include qgssnappingutils.sip
%Include qgsspatialindex.sip
%Include qgsstatisticalsummary.sip
%Include qgstolerance.sip
%Include qgsvectordataprovider.sip
%Include qgsvectorfilewriter.sip
@@ -83,7 +83,7 @@ class QgsExpression

double scale();

//! Return the expression string that was given when created.
//! Alias for dump()
const QString expression() const;

//! Return the expression string that represents this QgsExpression.
@@ -202,6 +202,13 @@ class QgsExpression
/** Does this function use a geometry object. */
bool usesgeometry();

/** Returns a list of possible aliases for the function. These include
* other permissible names for the function, eg deprecated names.
* @return list of known aliases
* @note added in QGIS 2.9
*/
virtual QStringList aliases() const;

/** True if this function should use lazy evaluation. Lazy evaluation functions take QgsExpression::Node objects
* rather than the node results when called. You can use node->eval(parent, feature) to evaluate the node and return the result
* Functions are non lazy default and will be given the node return value when called **/
@@ -231,7 +238,7 @@ class QgsExpression
static bool isFunctionName( QString name );

// return index of the function in Functions array
static int functionIndex( QString name );
static int functionIndex( const QString& name );

/** Returns the number of functions defined in the parser
* @return The number of function defined in the parser.
@@ -1,10 +1,9 @@

/**
\class QgsField
\brief Class to encapsulate a field in an attribute table or data source.

QgsField stores metadata about an attribute field, including name, type
length, and if applicable, precision.
/** \class QgsField
* \ingroup core
* Encapsulate a field in an attribute table or data source.
* QgsField stores metadata about an attribute field, including name, type
* length, and if applicable, precision.
* \note QgsField objects are implicitly shared.
*/

class QgsField
@@ -34,14 +33,18 @@ public:
int prec = 0,
QString comment = QString() );

/** Copy constructor
*/
QgsField( const QgsField& other );

//! Destructor
~QgsField();
virtual ~QgsField();

bool operator==( const QgsField& other ) const;
bool operator!=( const QgsField& other ) const;

//! Gets the name of the field
const QString & name() const;
const QString& name() const;

//! Gets variant type of the field as it will be retrieved from data source
QVariant::Type type() const;
@@ -52,16 +55,14 @@ public:
the data store reports it, with no attempt to standardize the value.
@return QString containing the field type
*/
const QString & typeName() const;

const QString& typeName() const;

/**
Gets the length of the field.
@return int containing the length of the field
*/
int length() const;


/**
Gets the precision of the field. Not all field types have a related precision.
@return int containing the precision or zero if not applicable to the field type.
@@ -71,13 +72,13 @@ public:
/**
Returns the field comment
*/
const QString & comment() const;
const QString& comment() const;

/**
Set the field name.
@param nam Name of the field
@param name Name of the field
*/
void setName( const QString & nam );
void setName( const QString& name );

/**
Set variant type.
@@ -86,9 +87,9 @@ public:

/**
Set the field type.
@param typ Field type
@param typeName Field type
*/
void setTypeName( const QString & typ );
void setTypeName( const QString& typeName );

/**
Set the field length.
@@ -98,15 +99,14 @@ public:

/**
Set the field precision.
@param prec Precision of the field
@param precision Precision of the field
*/
void setPrecision( int prec );

void setPrecision( int precision );

/**
Set the field comment
*/
void setComment( const QString & comment );
void setComment( const QString& comment );

/** Formats string for display*/
QString displayString( const QVariant& v ) const;
@@ -171,6 +171,15 @@ public:
}; // class QgsField


/** \class QgsFields
* \ingroup core
* Container of fields for a vector layer.
*
* In addition to storing a list of QgsField instances, it also:
* - allows quick lookups of field names to index in the list
*- keeps track of where the field definition comes from (vector data provider, joined layer or newly added from an editing operation)
* \note QgsFields objects are implicitly shared.
*/

class QgsFields
{
@@ -188,6 +197,16 @@ class QgsFields
OriginExpression //!< field is calculated from an expression
};

/** Constructor for an empty field container
*/
QgsFields();

/** Copy constructor
*/
QgsFields( const QgsFields& other );

virtual ~QgsFields();

//! Remove all fields
void clear();
//! Append a field. The field must have unique name, otherwise it is rejected (returns false)
@@ -217,7 +236,7 @@ class QgsFields
bool exists( int i ) const;

//! Get field at particular index (must be in range 0..N-1)
// inline const QgsField& operator[]( int i ) const;
// const QgsField& operator[]( int i ) const;
QgsField& operator[](int i) /Factory/;
%MethodCode
SIP_SSIZE_T idx = sipConvertFromSequenceIndex(a0, sipCpp->count());
@@ -0,0 +1,157 @@
/** \ingroup core
* \class QgsStatisticalSummary
* \brief Calculator for summary statistics for a list of doubles.
*
* Statistics are calculated by calling @link calculate @endlink and passing a list of doubles. The
* individual statistics can then be retrieved using the associated methods. Note that not all statistics
* are calculated by default. Statistics which require slower computations are only calculated by
* specifying the statistic in the constructor or via @link setStatistics @endlink.
*
* \note Added in version 2.9
*/

class QgsStatisticalSummary
{
%TypeHeaderCode
#include <qgsstatisticalsummary.h>
%End

public:

//! Enumeration of flags that specify statistics to be calculated
enum Statistic
{
Count, //!< Count
Sum, //!< Sum of values
Mean, //!< Mean of values
Median, //!< Median of values
StDev, //!< Standard deviation of values
StDevSample, //!< Sample standard deviation of values
Min, //!< Min of values
Max, //!< Max of values
Range, //!< Range of values (max - min)
Minority, //!< Minority of values
Majority, //!< Majority of values
Variety, //!< Variety (count of distinct) values
FirstQuartile, //!< First quartile
ThirdQuartile, //!< Third quartile
InterQuartileRange, //!< Inter quartile range (IQR)
All
};
typedef QFlags<QgsStatisticalSummary::Statistic> Statistics;

/** Constructor for QgsStatisticalSummary
* @param stats flags for statistics to calculate
*/
QgsStatisticalSummary( QgsStatisticalSummary::Statistics stats = QgsStatisticalSummary::Statistics( 0 ) );

virtual ~QgsStatisticalSummary();

/** Returns flags which specify which statistics will be calculated. Some statistics
* are always calculated (eg sum, min and max).
* @see setStatistics
*/
QgsStatisticalSummary::Statistics statistics() const;

/** Sets flags which specify which statistics will be calculated. Some statistics
* are always calculated (eg sum, min and max).
* @param stats flags for statistics to calculate
* @see statistics
*/
void setStatistics( QgsStatisticalSummary::Statistics stats );

/** Resets the calculated values
*/
void reset();

/** Calculates summary statistics for a list of values
* @param values list of doubles
*/
void calculate( const QList<double>& values );

/** Returns calculated count of values
*/
int count() const;

/** Returns calculated sum of values
*/
double sum() const;

/** Returns calculated mean of values
*/
double mean() const;

/** Returns calculated median of values. This is only calculated if Statistic::Median has
* been specified in the constructor or via setStatistics.
*/
double median() const;

/** Returns calculated minimum from values.
*/
double min() const;

/** Returns calculated maximum from values.
*/
double max() const;

/** Returns calculated range (difference between maximum and minimum values).
*/
double range() const;

/** Returns population standard deviation. This is only calculated if Statistic::StDev has
* been specified in the constructor or via setStatistics.
* @see sampleStDev
*/
double stDev() const;

/** Returns sample standard deviation. This is only calculated if Statistic::StDev has
* been specified in the constructor or via setStatistics.
* @see stDev
*/
double sampleStDev() const;

/** Returns variety of values. The variety is the count of unique values from the list.
* This is only calculated if Statistic::Variety has been specified in the constructor
* or via setStatistics.
*/
int variety() const;

/** Returns minority of values. The minority is the value with least occurances in the list
* This is only calculated if Statistic::Minority has been specified in the constructor
* or via setStatistics.
* @see majority
*/
double minority() const;

/** Returns majority of values. The majority is the value with most occurances in the list
* This is only calculated if Statistic::Majority has been specified in the constructor
* or via setStatistics.
* @see minority
*/
double majority() const;

/** Returns the first quartile of the values. The quartile is calculated using the
* "Tukey's hinges" method.
* @see thirdQuartile
* @see interQuartileRange
*/
double firstQuartile() const;

/** Returns the third quartile of the values. The quartile is calculated using the
* "Tukey's hinges" method.
* @see firstQuartile
* @see interQuartileRange
*/
double thirdQuartile() const;

/** Returns the inter quartile range of the values. The quartiles are calculated using the
* "Tukey's hinges" method.
* @see firstQuartile
* @see thirdQuartile
*/
double interQuartileRange() const;

};

QFlags<QgsStatisticalSummary::Statistic> operator|(QgsStatisticalSummary::Statistic f1, QFlags<QgsStatisticalSummary::Statistic> f2);

0 comments on commit 8902a86

Please sign in to comment.
You can’t perform that action at this time.