Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Add not null option for OSM export
  • Loading branch information
kiselev-dv committed May 4, 2015
1 parent ce18a60 commit 8902a86
Show file tree
Hide file tree
Showing 75 changed files with 3,004 additions and 361 deletions.
7 changes: 7 additions & 0 deletions cmake/FindGRASS.cmake
Expand Up @@ -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})
Expand Down
4 changes: 2 additions & 2 deletions python/core/composer/qgscomposermap.sip
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions python/core/core.sip
Expand Up @@ -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
Expand Down
11 changes: 9 additions & 2 deletions python/core/qgsexpression.sip
Expand Up @@ -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.
Expand Down Expand Up @@ -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 **/
Expand Down Expand Up @@ -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.
Expand Down
63 changes: 41 additions & 22 deletions python/core/qgsfield.sip
@@ -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
Expand Down Expand Up @@ -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;
Expand All @@ -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.
Expand All @@ -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.
Expand All @@ -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.
Expand All @@ -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;
Expand Down Expand Up @@ -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
{
Expand All @@ -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)
Expand Down Expand Up @@ -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());
Expand Down
157 changes: 157 additions & 0 deletions python/core/qgsstatisticalsummary.sip
@@ -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.