[QGIS-Developer] Plugin [1516] QGIS Full Motion Video approval notification.

2018-08-10 Thread noreply

Plugin QGIS Full Motion Video approval by pcav.
The plugin version "[1516] QGIS Full Motion Video 1.2" is now approved
Link: http://plugins.qgis.org/plugins/QGIS_FMV/
___
QGIS-Developer mailing list
QGIS-Developer@lists.osgeo.org
List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer

Re: [QGIS-Developer] Difference in area calculation using memory vs output layer

2018-08-10 Thread Rudi von Staden
On Thu, 9 Aug 2018 at 08:39, Nyall Dawson  wrote:

> On Wed, 8 Aug 2018 at 18:06, Rudi von Staden  wrote:
>
> >
> > I did also calculate a range of zonal stats on the layer (which has only
> one multipolygon feature), but those results were consistent between output
> / memory layers.
> >
> > Is the area difference expected because of how shapefiles store geometry
> vs how they are handled by memory layers, or could there be a bug
> somewhere? Maybe this isn't the recommended way to calculate area? In case
> it matters, I'm using a custom CRS:
> >
> > "+proj=aea +lat_1=-24 +lat_2=-32 +lat_0=0 +lon_0=24 +x_0=0 +y_0=0
> +datum=WGS84 +units=m +no_defs"
>
> This may be a silly question -- but can you confirm that both layers
> are definitely in the same CRS?
>

Yes, they are both the result of an algorithm operating on the same source
layer.


> If so, I'd try exporting the two geometries to WKT and inspect for
> differences.
>

There are partial differences between the WKT. It seems that the OGR layer
drops some polygons. I also used isGeosValid() to check the validity, and
the OGR layer reported invalid geometry, while the Memory layer was valid.
I should note that the input layer has some invalid geometries (I'm using
buffer by 0 to try to clean up the geometry). I've put together a test
project and processing script to demonstrate the issue, including text
files with the WKT of the memory and ogr features. As a side-note, the
script also crashes QGIS a minute or so after running. I suspect it's
because I may have used incorrect output parameters.

https://www.dropbox.com/s/u1la8y63qlabiu4/area_test.zip?dl=0

Let me know if I should submit a bug report for this.

Rudi
___
QGIS-Developer mailing list
QGIS-Developer@lists.osgeo.org
List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer

Re: [QGIS-Developer] [Qgis-user] CAD and QGIS - Working with archaeological sites

2018-08-10 Thread C Hamilton
Somehow I missed seeing that plugin. It looks promising.

Thanks to everyone. This group is awesome!!!

On Fri, Aug 10, 2018 at 3:42 AM, Agustin Angel Diez Castillo <
agustin.d...@uv.es> wrote:

> Just in case, two things I may have overlooked in previous messages, you
> can vectorize your file, and you can do transparency by pixel as far as you
> background is white 255, 255, 255 will do the trick. If you want to do some
> adjustments to the original images, or add other no georeferenced ones, the
> new freehand georeferencer [1] in Qgis 3x it is the perfect tool for
> archaeologists, at least for this one.
> Best
>  Agustín
> [1] http://gvellut.github.io/FreehandRasterGeoreferencer/
>
> El Viernes 10 Agosto 2018 03:17 CEST, Nyall Dawson 
> Ha escrito:
>
> > On Fri, 10 Aug 2018 at 11:11, C Hamilton  wrote:
> > >
> > > Thanks!!! That is a good idea to use the layout panel.
> > >
> > > The advanced digitizing panel was the piece that I was missing. Yes
> the tools in QGIS 3 are much better.
> >
> > This is certainly a novel task to do in QGIS. I'd love to see a write
> > up/case study/blog post detailing your experiences after you've
> > finished!
> >
> > Nyall
> >
> > >
> > > On Thu, Aug 9, 2018 at 7:49 PM, Nyall Dawson 
> wrote:
> > >>
> > >> On Fri, 10 Aug 2018 at 08:01, Alexandre Neto 
> wrote:
> > >> >
> > >> > Hi,
> > >> >
> > >> > On Thu, Aug 9, 2018, 22:27 C Hamilton 
> wrote:
> > >> >>
> > >> >>
> > >> >> Also is there a way a non georegistered image be imported, make it
> somewhat transparent, and then interactively drag and resize it on the map
> somewhat like Google Earth? When you don't really have anything to
> reference the image to you can't use georeferencer.
> > >> >
> > >> >
> > >> > I guess you could do that on layout mode. Adding an imagem, set
> some transparency and then try to fit it somewhere.
> > >> >
> > >> > Once it's on the right spot. Save the layout as image storing a
> world file. Then you can add it back, and use georeferencer on the original
> image.
> > >>
> > >> Actually if you save the world file you shouldn't need to use
> > >> georeferencer - it should be placed in the correct place immediately
> > >> after loading in QGIS.
> > >>
> > >> > I am not a CAD guy, so I would trace it using QGIS.
> > >>
> > >> Just to add to this - the digitizing tools in QGIS are very powerful
> > >> now (especially with the new shape digitizing toolbar in 3.0, and the
> > >> Advanced Digitizing dock. I'd go with that approach as doing it in the
> > >> GIS means that it's inherently spatial data - vs doing it in CAD,
>
> > >> which means you've gotta manage the spatial reference manually.
> > >>
> > >> Nyall
> > >
> > >
> > ___
> > Qgis-user mailing list
> > qgis-u...@lists.osgeo.org
> > List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
> > Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user
>
>
>
>
>
___
QGIS-Developer mailing list
QGIS-Developer@lists.osgeo.org
List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer

Re: [QGIS-Developer] OpenCL and macOS

2018-08-10 Thread Tom Elwertowski
For macOS, copying cl2.hpp from 
https://github.com/KhronosGroup/OpenCL-CLHPP/releases to 
/usr/local/include/CL works.


Setting USE_OPENCL=OFF also works to disable OpenCL.

One or the other is necessary or macOS will try the use the v1.2 C 
headers provided by Apple and pointed to by OpenCL_INCLUDE_DIR.


After lanuching QGIS, I see the Options|Acceleration panel with three 
choices:

Intel(R) Core(TM) i7-3615QM CPU @ 2.30GHz
HD Graphics 4000
GeForce GT 650M

To automate the mac build, my suggestion is to create a 
OpenCL_HPP_INCLUDE_DIR variable. If a mac user sets it, use OpenCL; if 
not, don't use OpenCL. For other platforms, OpenCL_HPP_INCLUDE_DIR is 
automatically set to OpenCL_INCLUDE_DIR.


Tom

___
QGIS-Developer mailing list
QGIS-Developer@lists.osgeo.org
List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer

Re: [QGIS-Developer] QGIS builds

2018-08-10 Thread Rudi von Staden
On Wed, 8 Aug 2018 at 23:47, Nyall Dawson  wrote:

> > I have the build environment set up from scratch on a new computer, and
> I'm getting the same error building mdalprovider in the master branch
> (C:\OSGeo4W64\bin\hdf5.dll : fatal error LNK1107: invalid or corrupt file:
> cannot read at 0x2F0).
>
> I've seen this too. I haven't had time to investigate a proper fix, so
> in the meantime I just edit src/providers/mdal/CMakeLists.txt and
> remove all mention of HDF5. That gets the build working temporarily.
>

Thanks, that worked. I also encountered an issue with `synccrsdb` (MSB6006
cmd.exe exited with code -1073741515). In case anyone else comes across
that, the solution was to copy crssync.exe from 'OSGeo4W64\apps\qgis-dev'
to 'C:\OSGeo4W64\bin'. It's probably in one of the other osgeo4w packages,
but I haven't figured out which one yet.

Rudi
___
QGIS-Developer mailing list
QGIS-Developer@lists.osgeo.org
List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer

Re: [QGIS-Developer] How to create a simple processing script in QGIS 3.x, eg just a buffer

2018-08-10 Thread Anita Graser
Great, thanks for sharing, Andrew!

Anita

On Fri, Aug 10, 2018 at 2:05 PM Andrew C  wrote:

> Hi Anita,
>
> I worked it out. Here is a very simple replication of a buffer for
> scripting, in case anyone else needs it. I don't know if this is best
> practice but it works for a simple test. I didn't realise I could parse
> parameters['INPUT'] as an input.
>
> Thanks for your help
>
> Kind Regards
>
> Andrew
>
> import processing
> from qgis.PyQt.QtCore import QCoreApplication
> from qgis.core import QgsProcessingAlgorithm, QgsProcessing,
> QgsProcessingParameterFeatureSink,QgsProcessingParameterFeatureSource
>
> class testAlg(QgsProcessingAlgorithm):
> OUTPUT = 'OUTPUT'
> INPUT = 'INPUT'
>
> def tr(self, text):
> return QCoreApplication.translate('testalg', text)
>
> def createInstance(self):
> return type(self)()
>
> def group(self):
> return self.tr('Test')
>
> def groupId(self):
> return 'test'
>
> def __init__(self):
> super().__init__()
>
> def initAlgorithm(self, config=None):
>
> self.addParameter(
> QgsProcessingParameterFeatureSource(
> self.INPUT,
> self.tr('Input layer'),
> [QgsProcessing.TypeVectorAnyGeometry]
> )
> )
>
> self.addParameter(
> QgsProcessingParameterFeatureSink(
> self.OUTPUT,
> self.tr('Output'),
> QgsProcessing.TypeVectorPolygon
> )
> )
>
> def name(self):
> return 'testalg'
>
> def displayName(self):
> return self.tr('Test Algorithm')
>
> def processAlgorithm(self, parameters, context, feedback):
>
> output = processing.run("native:buffer", {
> 'INPUT': parameters['INPUT'],
> 'DISTANCE': 10,
> 'SEGMENTS': 5,
> 'END_CAP_STYLE': 0,
> 'JOIN_STYLE': 0,
> 'MITER_LIMIT': 2,
> 'DISSOLVE': False,
> 'OUTPUT': parameters['OUTPUT']
> }, context=context, feedback=feedback)['OUTPUT']
>
> return {self.OUTPUT: output}
>
> On Thu, Aug 9, 2018 at 5:29 PM Andrew C  wrote:
>
>> Hi Anita,
>>
>> Thanks very much for this. I am still lost though. If I replace the sink
>> and add your code I don't get an output in the dialog box - it needs to be
>> a parameter for that to happen right?
>>
>> I found this
>> https://gis.stackexchange.com/questions/282773/writing-a-python-processing-script-with-qgis-3-0
>> which lead me to this
>> https://github.com/qgis/QGIS/blob/master/doc/porting_processing.dox
>>
>> Which is recommending "Best practice in 3.x Processing algorithms is to
>> use "feature sinks" instead of vector layer outputs"
>>
>>
>> Kind Regards
>> Andrew
>>
>>
>>
>> On Thu, Aug 9, 2018 at 2:23 PM Anita Graser  wrote:
>>
>>> Hi Andrew,
>>>
>>> On Thu, Aug 9, 2018 at 2:57 PM Andrew C  wrote:
>>>
 I am not clear on how QgsFeatureSinkis working, perhaps that is why I
 am not getting the buffered layer? Normally in a script I could try
 printing variables I cannot see where these are printed either when I
 tested.

>>>
>>> I think you'd need an output layer instead of a feature sink. Have a
>>> look at
>>> https://github.com/qgis/QGIS/blob/master/python/plugins/processing/algs/qgis/PostGISExecuteAndLoadSQL.py
>>>
>>> self.addOutput(QgsProcessingOutputVectorLayer(
>>>
>>> self.OUTPUT,
>>>
>>> self.tr("Output layer"),
>>>
>>> QgsProcessing.TypeVectorAnyGeometry))
>>>
>>> Regards,
>>> Anita
>>>
>>>
___
QGIS-Developer mailing list
QGIS-Developer@lists.osgeo.org
List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer

Re: [QGIS-Developer] How to create a simple processing script in QGIS 3.x, eg just a buffer

2018-08-10 Thread Andrew C
Hi Anita,

I worked it out. Here is a very simple replication of a buffer for
scripting, in case anyone else needs it. I don't know if this is best
practice but it works for a simple test. I didn't realise I could parse
parameters['INPUT'] as an input.

Thanks for your help

Kind Regards

Andrew

import processing
from qgis.PyQt.QtCore import QCoreApplication
from qgis.core import QgsProcessingAlgorithm, QgsProcessing,
QgsProcessingParameterFeatureSink,QgsProcessingParameterFeatureSource

class testAlg(QgsProcessingAlgorithm):
OUTPUT = 'OUTPUT'
INPUT = 'INPUT'

def tr(self, text):
return QCoreApplication.translate('testalg', text)

def createInstance(self):
return type(self)()

def group(self):
return self.tr('Test')

def groupId(self):
return 'test'

def __init__(self):
super().__init__()

def initAlgorithm(self, config=None):

self.addParameter(
QgsProcessingParameterFeatureSource(
self.INPUT,
self.tr('Input layer'),
[QgsProcessing.TypeVectorAnyGeometry]
)
)

self.addParameter(
QgsProcessingParameterFeatureSink(
self.OUTPUT,
self.tr('Output'),
QgsProcessing.TypeVectorPolygon
)
)

def name(self):
return 'testalg'

def displayName(self):
return self.tr('Test Algorithm')

def processAlgorithm(self, parameters, context, feedback):

output = processing.run("native:buffer", {
'INPUT': parameters['INPUT'],
'DISTANCE': 10,
'SEGMENTS': 5,
'END_CAP_STYLE': 0,
'JOIN_STYLE': 0,
'MITER_LIMIT': 2,
'DISSOLVE': False,
'OUTPUT': parameters['OUTPUT']
}, context=context, feedback=feedback)['OUTPUT']

return {self.OUTPUT: output}

On Thu, Aug 9, 2018 at 5:29 PM Andrew C  wrote:

> Hi Anita,
>
> Thanks very much for this. I am still lost though. If I replace the sink
> and add your code I don't get an output in the dialog box - it needs to be
> a parameter for that to happen right?
>
> I found this
> https://gis.stackexchange.com/questions/282773/writing-a-python-processing-script-with-qgis-3-0
> which lead me to this
> https://github.com/qgis/QGIS/blob/master/doc/porting_processing.dox
>
> Which is recommending "Best practice in 3.x Processing algorithms is to
> use "feature sinks" instead of vector layer outputs"
>
>
> Kind Regards
> Andrew
>
>
>
> On Thu, Aug 9, 2018 at 2:23 PM Anita Graser  wrote:
>
>> Hi Andrew,
>>
>> On Thu, Aug 9, 2018 at 2:57 PM Andrew C  wrote:
>>
>>> I am not clear on how QgsFeatureSinkis working, perhaps that is why I am
>>> not getting the buffered layer? Normally in a script I could try printing
>>> variables I cannot see where these are printed either when I tested.
>>>
>>
>> I think you'd need an output layer instead of a feature sink. Have a look
>> at
>> https://github.com/qgis/QGIS/blob/master/python/plugins/processing/algs/qgis/PostGISExecuteAndLoadSQL.py
>>
>> self.addOutput(QgsProcessingOutputVectorLayer(
>>
>> self.OUTPUT,
>>
>> self.tr("Output layer"),
>>
>> QgsProcessing.TypeVectorAnyGeometry))
>>
>> Regards,
>> Anita
>>
>>
___
QGIS-Developer mailing list
QGIS-Developer@lists.osgeo.org
List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer

[QGIS-Developer] QEP 130: Flexible history log/register

2018-08-10 Thread Nyall Dawson
Hi all,

Please see https://github.com/qgis/QGIS-Enhancement-Proposals/issues/130
for a newly filed QEP regarding an application wide history/log
register.

Comments, suggestions and feedback is welcomed!

Nyall
___
QGIS-Developer mailing list
QGIS-Developer@lists.osgeo.org
List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer

Re: [QGIS-Developer] QGIS3: Can two different plugins have a common processing provider?

2018-08-10 Thread Tejas L
Nyall: It's the second option: we want a single provider into which multiple 
plugins add their respective sets of algorithms.

Etienne: If a provider is already loaded, how can I add my algorithm to it? 
QGIS crashes when i try to add an algorithm from plugin X into a provider from 
plugin Y. Would be great If you have a working snippet.

From: Nyall Dawson 
Sent: Friday, August 10, 2018 5:20 AM
To: tej...@live.com
Cc: qgis-developer
Subject: Re: [QGIS-Developer] QGIS3: Can two different plugins have a common 
processing provider?

On Fri, 10 Aug 2018 at 02:31, Tejas L  wrote:
>
> Hello!
>
> We are releasing multiple QGIS3 plugins, each with their own processing 
> algorithms. We would like the processing algorithms of these plugins to 
> appear under a single Processing provider in the Processing toolbox. How can 
> we achieve this?
>

To clarify: Are you wanting the exact same provider to be included in
multiple plugins (with the same algorithms)

OR

A single provider, but multiple plugins which each add different sets
of algorithms to this same provider?

Nyall
___
QGIS-Developer mailing list
QGIS-Developer@lists.osgeo.org
List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer