Re: [Qgis-developer] Map Canvas Current Zoomed Extent

2014-01-13 Thread bjorn.burr.nyb...@gmail.com
Related to the second portion of my question regarding getting an image of
the rendered canvas extent as an output i've tried to implement the
following as modified from the pyqgis handbook

from qgis.core import *
from qgis.gui import *
from PyQt4.QtCore import *
from PyQt4.QtGui import *
from PyQt4.QtXml import *

output = r'C:\output.png'

mc = iface.mapCanvas()
rect = mc.extent()
img = QImage(QSize(800,600), QImage.Format_ARGB32_Premultiplied)
color = QColor(255,255,255)
img.fill(color.rgb())
p = QPainter()
p.begin(img)
p.setRenderHint(QPainter.Antialiasing)
render = QgsMapRenderer()
render.setExtent(rect)
render.setOutputSize(img.size(), img.logicalDpiX())
render.render(p)
p.end()
img.save(output,png)

however the resulting image that I receive is simply a blank white image
(from the im.fill step) in addition im not entirely sure how the size of the
QImage can be related to the current extent rect? 

Again any help would be appreciated,
Cheers,
Bjorn



--
View this message in context: 
http://osgeo-org.1560.x6.nabble.com/Map-Canvas-Current-Zoomed-Extent-tp5097678p5097818.html
Sent from the Quantum GIS - Developer mailing list archive at Nabble.com.
___
Qgis-developer mailing list
Qgis-developer@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/qgis-developer


[Qgis-developer] Processing Python Error on Startup

2013-10-06 Thread bjorn.burr.nyb...@gmail.com
Hi, 
I have this error that keeps occuring and i've tried fixing it all afternoon
but with no luck and its slowly driving me crazy. I tried to change the r
scripts processing location to my r folder but after I changed those
settings in the processing options I cant load the processing plugin!
Somehow despite trying to delete every known qgis file and reinstalling
either with the installer or through osgeo4w it keeps trying to create a
folder in my R directory giving the error making me believe it somehow is
remember that location somehow? temp PATH maybe?

Couldn't load plugin processing due an error when calling its classFactory()
method
C:/PROGRA~2/QGISDU~1/apps/qgis/./python/plugins\processing\core\ProcessingUtils.py,
line 97, in mkdir
os.mkdir(newdir)
WindowsError: [Error 123] The filename, directory name, or volume label
syntax is incorrect: 'G:\\R-3.0.2\\scripts\r'

I don't even really need R can I somehow prevent processing from even
loading it?
Any help would be appreciated,
Cheers,
Bjorn

Couldn't load plugin processing due an error when calling its classFactory()
method

Traceback (most recent call last):
  File C:/PROGRA~2/QGISDU~1/apps/qgis/./python\qgis\utils.py, line 204, in
startPlugin
plugins[packageName] = package.classFactory(iface)
  File
C:/PROGRA~2/QGISDU~1/apps/qgis/./python/plugins\processing\__init__.py,
line 33, in classFactory
return ProcessingPlugin(iface)
  File
C:/PROGRA~2/QGISDU~1/apps/qgis/./python/plugins\processing\ProcessingPlugin.py,
line 53, in __init__
Processing.initialize()
  File
C:/PROGRA~2/QGISDU~1/apps/qgis/./python/plugins\processing\core\Processing.py,
line 140, in initialize
Processing.loadFromProviders()
  File
C:/PROGRA~2/QGISDU~1/apps/qgis/./python/plugins\processing\core\Processing.py,
line 151, in loadFromProviders
Processing.loadAlgorithms()
  File
C:/PROGRA~2/QGISDU~1/apps/qgis/./python/plugins\processing\core\Processing.py,
line 174, in loadAlgorithms
Processing.updateProviders()
  File
C:/PROGRA~2/QGISDU~1/apps/qgis/./python/plugins\processing\core\Processing.py,
line 158, in updateProviders
provider.loadAlgorithms()
  File
C:/PROGRA~2/QGISDU~1/apps/qgis/./python/plugins\processing\core\AlgorithmProvider.py,
line 53, in loadAlgorithms
self._loadAlgorithms()
  File
C:/PROGRA~2/QGISDU~1/apps/qgis/./python/plugins\processing\r\RAlgorithmProvider.py,
line 74, in _loadAlgorithms
folder = RUtils.RScriptsFolder()
  File
C:/PROGRA~2/QGISDU~1/apps/qgis/./python/plugins\processing\r\RUtils.py,
line 55, in RScriptsFolder
mkdir(folder)
  File
C:/PROGRA~2/QGISDU~1/apps/qgis/./python/plugins\processing\core\ProcessingUtils.py,
line 97, in mkdir
os.mkdir(newdir)
WindowsError: [Error 123] The filename, directory name, or volume label
syntax is incorrect: 'G:\\R-3.0.2\\scripts\r'

Python version:
2.7.4 (default, Apr  6 2013, 19:54:46) [MSC v.1500 32 bit (Intel)]


QGIS version:
2.0.1-Dufour Dufour, 34139bc

Python path: ['C:/PROGRA~2/QGISDU~1/apps/qgis/./python/plugins\\processing',
'C:/PROGRA~2/QGISDU~1/apps/qgis/./python',
'C:\\Users\\install.CIPR064108.000/.qgis2/python',
'C:\\Users\\install.CIPR064108.000/.qgis2/python/plugins',
'C:/PROGRA~2/QGISDU~1/apps/qgis/./python/plugins',
'C:\\PROGRA~2\\QGISDU~1\\bin\\python27.zip',
'C:\\PROGRA~2\\QGISDU~1\\apps\\Python27\\DLLs',
'C:\\PROGRA~2\\QGISDU~1\\apps\\Python27\\lib',
'C:\\PROGRA~2\\QGISDU~1\\apps\\Python27\\lib\\plat-win',
'C:\\PROGRA~2\\QGISDU~1\\apps\\Python27\\lib\\lib-tk',
'C:\\PROGRA~2\\QGISDU~1\\bin', 'C:\\PROGRA~2\\QGISDU~1\\apps\\Python27',
'C:\\PROGRA~2\\QGISDU~1\\apps\\Python27\\lib\\site-packages',
'C:\\PROGRA~2\\QGISDU~1\\apps\\Python27\\lib\\site-packages\\PIL',
'C:\\PROGRA~2\\QGISDU~1\\apps\\Python27\\lib\\site-packages\\win32',
'C:\\PROGRA~2\\QGISDU~1\\apps\\Python27\\lib\\site-packages\\win32\\lib',
'C:\\PROGRA~2\\QGISDU~1\\apps\\Python27\\lib\\site-packages\\Pythonwin',
'C:\\PROGRA~2\\QGISDU~1\\apps\\Python27\\lib\\site-packages\\wx-2.8-msw-unicode',
'C:\\PROGRA~2\\QGISDU~1\\apps\\qgis\\python\\plugins\\fTools\\tools']




--
View this message in context: 
http://osgeo-org.1560.x6.nabble.com/Processing-Python-Error-on-Startup-tp5082070.html
Sent from the Quantum GIS - Developer mailing list archive at Nabble.com.
___
Qgis-developer mailing list
Qgis-developer@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/qgis-developer


[Qgis-developer] OTB Configuration for Processing Toolbox

2013-10-04 Thread bjorn.burr.nyb...@gmail.com
Hello,
Has anyone configured a standalone OTB installation within the Processing
toolbox before? I have tried to configure it in the following manner...

OTB applications folder - ...\Monteverdi2-0.4\lib\otb\applications
OTB Command line tools folder - ...\Monteverdi2-0.4\bin

however everytime i try and run a script i receive the following error
message

'...\Monteverdi2-0.4\bin\otbcli_Segmentation' is not recognized as an
internal or external command, 
operable program or batch file. 

Interestingly in my Monteverdi there is no file otbcli_Segmentation but
rather otbapp_Segmentation so I do not know if that is the problem for me
(i've tried to rename it though with no luck)? In addition I dont know if it
should be running from the \bin folder considering that the .dll resides in
the \applications folder.

Any help would be appreciated,
Cheers,
Bjorn



--
View this message in context: 
http://osgeo-org.1560.x6.nabble.com/OTB-Configuration-for-Processing-Toolbox-tp5081774.html
Sent from the Quantum GIS - Developer mailing list archive at Nabble.com.
___
Qgis-developer mailing list
Qgis-developer@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/qgis-developer


Re: [Qgis-developer] OTB Configuration for Processing Toolbox

2013-10-04 Thread bjorn.burr.nyb...@gmail.com
Cheers,
That was simple enough... however i've run into another problem which i hope
is just as simple.  Whenever i run an application with a vector output i
receive the following error (this example from Mean Edision Segmentation).

Segmentation -filter edison -in
Users\INSTAL~1.000\AppData\Local\Temp\processing\73bc3696f1044433be48fa47d40f293b\-out.tif
-filter.edison.spatialr 5 -filter.edison.ranger 15 -filter.edison.minsize
100 -filter.edison.scale 1 -mode.vector.stitch true -mode.vector.minsize 1
-mode.vector.simplify 0 -mode.vector.layername layer -mode.vector.tilesize
1024 -mode.vector.startlabel 1 -mode.vector.outmode ulco -mode vector
-mode.vector.out
C:\Users\INSTAL~1.000\AppData\Local\Temp\processing\601c72ba4790494694bbc4e28c6288ab\-mode
vector -mode.vector.out.shp 

ERROR: option -mode.vector.out.shp does not exist in the application. 

This is the Segmentation application. 
(here it starts to describe the parameters for that application)

Any ideas?
Thanks
Bjorn



--
View this message in context: 
http://osgeo-org.1560.x6.nabble.com/OTB-Configuration-for-Processing-Toolbox-tp5081774p5081903.html
Sent from the Quantum GIS - Developer mailing list archive at Nabble.com.
___
Qgis-developer mailing list
Qgis-developer@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/qgis-developer


[Qgis-developer] Chain Temporary Algorithms

2013-07-26 Thread bjorn.burr.nyb...@gmail.com
Hej Everyone,
New to the mailing list here... and I am having some trouble writing a
script that I was hoping someone could lend me a hand with. Mainly this is a
script I use to get centerline's of a polygon that I used in ArcGIS before
and I want to adapt it to work in QGIS. Anyways there are a sequence of
algorithms from qgis that I want to use in memory before getting the final
output as a series of points (which then need to be processed further)
however chaining these algorithms simply fails after the first one where the
output is simply not being created for the next step to process.

Here is a snippet of that code - any help would be appreciated!
Cheers,
Bjorn

#Definition of inputs and outputs
#==
##[Example scripts]=group
##Polygon=vector
##Detail=number 1000
##Scale=boolean True
##All_Paths=boolean False
##Output=output vector

#Algorithm body
#==
import sextante as st

densify = st.runalg(qgis:densifygeometries),inFC,Detail,None)
extractNodes = st.runalg(qgis:extractnodes,densify,None)
voronoi = st.runalg(qgis:voronoipolygons,extractNodes,None)
voronoi_lines = st.runalg(qgis:polygonstolines,voronoi,None)
polygon_lines = st.runalg(qgis:polygonstolines,inFC,None)
clip = st.runalg(qgis:clip,inFC,voronoi_lines,None)
out = st.runalg(qgis:difference,clip,polygon_lines,None)

layer = st.getobject(out)
features: = st.getfeatures(layer)
Points = []
for feature in features:
Points.append(features.geometry().asMultiPolyline())



--
View this message in context: 
http://osgeo-org.1560.x6.nabble.com/Chain-Temporary-Algorithms-tp5069057.html
Sent from the Quantum GIS - Developer mailing list archive at Nabble.com.
___
Qgis-developer mailing list
Qgis-developer@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/qgis-developer