Skip to content

Instantly share code, notes, and snippets.

View NathanW2's full-sized avatar

Nathan Woodrow NathanW2

View GitHub Profile
@NathanW2
NathanW2 / QGIS log
Created August 18, 2011 00:33
QGIS log
00000000 0.00000000 [1764] d:\src\qgis\src\app\qgscustomization.cpp(857) : (QgsCustomization::preNotify) click
00000001 0.21278715 [1764] d:\src\qgis\src\core\qgsdistancearea.cpp(160) : (QgsDistanceArea::setEllipsoid) setEllipsoid: a=6.37814e+06, b=6.37814e+06, 1/f=298.257
00000002 0.21283579 [1764] d:\src\qgis\src\core\qgscoordinatereferencesystem.cpp(351) : (QgsCoordinateReferenceSystem::createFromProj4) proj4: +proj=longlat +ellps=WGS84 +no_defs
00000003 0.21290582 [1764] d:\src\qgis\src\core\qgscoordinatereferencesystem.cpp(380) : (QgsCoordinateReferenceSystem::createFromProj4) proj string supplied has no +a argument
00000004 0.21295685 [1764] d:\src\qgis\src\core\qgscoordinatereferencesystem.cpp(542) : (QgsCoordinateReferenceSystem::getRecord) running query: select * from tbl_srs where parameters='+proj=longlat +ellps=WGS84 +no_defs'
00000005 0.35062841 [1764] d:\src\qgis\src\core\qgscoordinatereferencesystem.cpp(564) : (QgsCoordinateReferenceSystem::getRecord) trying system srs.db
00000006 0.35112
mapC = qgis.utils.iface.mapCanvas()
layer = mapC.currentLayer()
provider = layer.dataProvider()
feat = QgsFeature()
provider.nextFeature(feat)
myGeom = QgsGeometry( feat.geometry() )
layer.startEditing()
git checkout -b {your local branch name} release/1.2.3
EDIT EDIT EDIT
git commit -a -m "blah
git checkout master
git merge {your local branch name}
git tag release/1.2.3 -f
it push --tags
for f in *.shp
do
ogr2ogr -f "GeoJSON" $f.json $f layer
done
void QgsCompassPlugin::run()
{
QDockWidget* dock = new QDockWidget("Compass", qGisInterface->mainWindow() );
QgsCompassPluginGui *myQgsCompassPluginGui =
new QgsCompassPluginGui( dock );
dock->setWidget( myQgsCompassPluginGui );
dock->setAttribute( Qt::WA_DeleteOnClose );
dock->setFeatures(QDockWidget::DockWidgetClosable | QDockWidget::DockWidgetMovable | QDockWidget::DockWidgetFloatable);
qGisInterface->addDockWidget( Qt::LeftDockWidgetArea, dock );
dock->show();
diff --git a/src/app/qgisapp.cpp b/src/app/qgisapp.cpp
index bf22859..6e471d3 100644
--- a/src/app/qgisapp.cpp
+++ b/src/app/qgisapp.cpp
@@ -6246,6 +6246,8 @@ void QgisApp::projectProperties()
// It is needed to refresh scale bar after changing display units.
connect( pp, SIGNAL( refresh() ), mMapCanvas, SLOT( refresh() ) );
+ connect( pp, SIGNAL( userScalesChanged() ) , mScaleEdit, SLOT( updateScales() ) );
+
diff --git a/src/app/main.cpp b/src/app/main.cpp
index 3253a34..b202b46 100644
--- a/src/app/main.cpp
+++ b/src/app/main.cpp
@@ -315,6 +315,7 @@ int main( int argc, char *argv[] )
}
else if ( i + 1 < argc && ( arg == "--optionspath" || arg == "-o" ) )
{
+ QSettings::setDefaultFormat( QSettings::IniFormat );
QSettings::setPath( QSettings::IniFormat, QSettings::UserScope, argv[++i] );
@NathanW2
NathanW2 / gist:2987342
Created June 25, 2012 08:20
ini patch
commit 4da574283857472dccf5f614fada4c62bcefe580
Author: Nathan Woodrow <woodrow.nathan@gmail.com>
Date: Tue May 22 00:00:10 2012 +1000
Set the default format as INI when using custom settings path
diff --git a/src/app/main.cpp b/src/app/main.cpp
index 3253a34..b202b46 100644
--- a/src/app/main.cpp
+++ b/src/app/main.cpp
if ( match.contains( "day", Qt::CaseInsensitive ) ||
match.contains( QObject::tr("day", "Note: Word is part matched in code"), Qt::CaseInsensitive )||
match.contains( QObject::tr("days", "Note: Word is part matched in code"), Qt::CaseInsensitive) )
seconds += value * QgsExpression::Interval::DAY;
if ( match.contains( "week", Qt::CaseInsensitive ) ||
match.contains( QObject::tr("week", "Note: Word is part matched in code"), Qt::CaseInsensitive ) ||
match.contains( QObject::tr("weeks", "Note: Word is part matched in code"), Qt::CaseInsensitive ) )
seconds += value * QgsExpression::Interval::WEEKS;
if ( match.contains( "month", Qt::CaseInsensitive ) ||
match.contains( QObject::tr("month", "Note: Word is part matched in code"), Qt::CaseInsensitive ) ||
@NathanW2
NathanW2 / gist:3150290
Created July 20, 2012 11:40
QGIS init function
def myFunction(dialog, layer, feature):
geom = feature.geometry()
wkt = geom.exportToWkt()
# use the WKT in your PostGIS function to find the closest road