[Qgis-developer] Plugin [995] dzetsaka : Classification tool approval notification.

2016-06-23 Thread noreply

Plugin dzetsaka : Classification tool approval by pcav.
The plugin version "[995] dzetsaka : Classification tool 2.0" is now approved
Link: http://plugins.qgis.org/plugins/dzetsaka/
___
Qgis-developer mailing list
Qgis-developer@lists.osgeo.org
List info: http://lists.osgeo.org/mailman/listinfo/qgis-developer
Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-developer

[Qgis-developer] Plugin [246] Flow Trace approval notification.

2016-06-23 Thread noreply

Plugin Flow Trace approval by pcav.
The plugin version "[246] Flow Trace 0.4" is now approved
Link: http://plugins.qgis.org/plugins/flowTrace/
___
Qgis-developer mailing list
Qgis-developer@lists.osgeo.org
List info: http://lists.osgeo.org/mailman/listinfo/qgis-developer
Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-developer

Re: [Qgis-developer] custom charts?

2016-06-23 Thread Raymond Nijssen
Thanks Hugo, I will try to get this to work.

On 23-06-16 09:02, Hugo Mercier wrote:
> On 22/06/2016 19:06, Richard Duivenvoorde wrote:
>> On 22-06-16 14:39, Hugo Mercier wrote:
>>> Hi Raymond,
 - Add a text field to my feature layer containig svg, and somehow make
 qgis display that on my map;
>>>
>>> This should work, no ?
>>
>> Are you sure? This would mean that the value(!) of an attribute would
>> contain the actual svg (code, not filename).
>> Any example on how to use that with styling then?
> 
> Hmmm exact, I don't think you can include the content (I tried to
> include a data url but it does not work).
> 
>>
 - Add a text field to my feature layer containig a path to a png (or
 svg), and somehow make qgis display that on my map.
>>>
>>> An SVG marker with the file name defined as an expression ?
>>
>> Same here, while we managed to get for example colors dynamic, we could
>> not find a way (yet) to set the marker-svg once filename is retrieved
>> from an attribute...
>>
>> Happy to get an example or pointers :-)
> 
> with an SVG-marker the filename can be "data-defined", so you can for
> instance use an expression like '/xxx/mymarker_' || id || '.svg'
> 
> 
> ___
> Qgis-developer mailing list
> Qgis-developer@lists.osgeo.org
> List info: http://lists.osgeo.org/mailman/listinfo/qgis-developer
> Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-developer
> 


___
Qgis-developer mailing list
Qgis-developer@lists.osgeo.org
List info: http://lists.osgeo.org/mailman/listinfo/qgis-developer
Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-developer

Re: [Qgis-developer] Setting snapping settings via Python

2016-06-23 Thread Matthias Kuhn
On 06/23/2016 05:45 PM, Tom Chadwin wrote:
> Matthias's post is here:
> 
> https://lists.osgeo.org/pipermail/qgis-developer/2016-June/043418.html
> 
> He suggests:
> 
> QgsProject.instance().snapSettingsChanged()


Sorry, should probably be

QgsProject.instance().snapSettingsChanged.emit()

... I didn't verify that it works ...
___
Qgis-developer mailing list
Qgis-developer@lists.osgeo.org
List info: http://lists.osgeo.org/mailman/listinfo/qgis-developer
Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-developer

Re: [Qgis-developer] Setting snapping settings via Python

2016-06-23 Thread Tom Chadwin
Matthias's post is here:

https://lists.osgeo.org/pipermail/qgis-developer/2016-June/043418.html

He suggests:

QgsProject.instance().snapSettingsChanged()



--
View this message in context: 
http://osgeo-org.1560.x6.nabble.com/Setting-snapping-settings-via-Python-tp5246362p5273043.html
Sent from the Quantum GIS - Developer mailing list archive at Nabble.com.
___
Qgis-developer mailing list
Qgis-developer@lists.osgeo.org
List info: http://lists.osgeo.org/mailman/listinfo/qgis-developer
Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-developer

Re: [Qgis-developer] Setting snapping settings via Python

2016-06-23 Thread Tom Chadwin
Hi John

See Matthias's answer on this list just today to a more recent question.
Does that do the trick?

Tom



--
View this message in context: 
http://osgeo-org.1560.x6.nabble.com/Setting-snapping-settings-via-Python-tp5246362p5273040.html
Sent from the Quantum GIS - Developer mailing list archive at Nabble.com.
___
Qgis-developer mailing list
Qgis-developer@lists.osgeo.org
List info: http://lists.osgeo.org/mailman/listinfo/qgis-developer
Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-developer

Re: [Qgis-developer] Get size of SVG in Python

2016-06-23 Thread Tom Chadwin
This works:

xml.etree.ElementTree.parse(sl.path()).getroot().attrib["width"]

Happy with that unless there is A Better Way.



--
View this message in context: 
http://osgeo-org.1560.x6.nabble.com/Get-size-of-SVG-in-Python-tp5273032p5273035.html
Sent from the Quantum GIS - Developer mailing list archive at Nabble.com.
___
Qgis-developer mailing list
Qgis-developer@lists.osgeo.org
List info: http://lists.osgeo.org/mailman/listinfo/qgis-developer
Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-developer

[Qgis-developer] Get size of SVG in Python

2016-06-23 Thread Tom Chadwin
I need to get the width and height of an SVG file used as an SVG marker
symbol layer. To be explicit, the dimensions I need are the width and height
attributes of the  element. What's the best way to do that in PyQGIS?
Parse the XML (never done that in Python yet)? Or something in the QGIS API?
Some other technique?

Thanks

Tom



--
View this message in context: 
http://osgeo-org.1560.x6.nabble.com/Get-size-of-SVG-in-Python-tp5273032.html
Sent from the Quantum GIS - Developer mailing list archive at Nabble.com.
___
Qgis-developer mailing list
Qgis-developer@lists.osgeo.org
List info: http://lists.osgeo.org/mailman/listinfo/qgis-developer
Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-developer

Re: [Qgis-developer] Interpretation of a 3 point CircularString with p0 == p2 (circle)

2016-06-23 Thread Even Rouault
Le jeudi 23 juin 2016 16:01:10, Marco Hugentobler a écrit :
> Hi Even
> 
> I agree it will be good to follow the postgres / gdal interpretation.
> Reading S2, I somehow thought the segment midpoint would be the circle
> midpoint, but it's not the same.

Filed as https://hub.qgis.org/issues/15116

> 
> Regards,
> Marco
> 
> On 06/23/16 15:32, Even Rouault wrote:
> > Hi,
> > 
> > I just came into a difference how QGIS and GDAL interpret a
> > CircularString made of a 3 points p0, p1, p2 where p0 == p2, which is a
> > way of representing a full circle.
> > 
> > GDAL interprets p1 as the symetrical point of p0 with respect to the
> > center
> > (https://github.com/osgeo/gdal/blob/trunk/gdal/ogr/ogrcircularstring.cpp
> > #L640), that is p1 is on the perimeter of the circle, or said otherwise
> > the center of the circle is the midpoint of [p0,p1].
> > Whereas QGIS interprets p1 as the center of the circle (
> > https://github.com/qgis/QGIS/blob/master/src/core/geometry/qgsgeometryuti
> > ls.cpp#L359 )
> > 
> > I'd think GDAL interpretation is the right one, since according to
> > http://jtc1sc32.org/doc/N1101-1150/32N1107-WD13249-3--spatial.pdf (ISO
> > SQL MM Part 3), paragraph 4.1.6 :
> > (let's call this sentence S1)
> > """ In the case where the segment is a circle, then the center is located
> > at the midpoint of the line connecting the start point with the
> > intermediate point. """
> > 
> > But if you look a bit above in the paragraph, there's a sentence (call it
> > S2)
> > 
> > : """In the special case where a segment is a complete circle, that is,
> > : the
> > 
> > start and end points are coincident, then the intermediate point shall be
> > the midpoint of the segment. """, which looks confusing at first. I
> > think this sentence must be interpreted considering distances along the
> > curve, in which case the "midpoint of the segment" when doing a full
> > walk along the circle from p0 back to p0 is the symetrical point of p0
> > with respect to the center.
> > 
> > I think this interpretation is also more logical since, even in that
> > particular case, p0,p1,p2 are all on the arc, like in the general case.
> > 
> > I can also see that PostGIS (in
> > https://github.com/postgis/postgis/blob/svn-
> > trunk/liblwgeom/lwalgorithm.c#L252 ) has the same interpretation as GDAL
> > (*)
> > 
> > I'd be happy to read opinions regarding this.
> > 
> > Even
> > 
> > (*) Can also be shown with :
> > 
> > # SELECT
> > ST_AsText(ST_Envelope(ST_CurveToLine(ST_GeomFromText('CIRCULARSTRING(-1
> > 0,1 0,-1 0)';
> > 
> >st_astext
> > 
> > --
> > 
> >   POLYGON((-1 -1,-1 1,1 1,1 -1,-1 -1))
> > 
> > And http://postgis.net/docs/manual-2.2/using_postgis_dbmanagement.html
> > says "The exception to this is for a closed circle, where the start and
> > end points are the same. In this case the second point MUST be the
> > center of the arc, ie the opposite side of the circle.", which is
> > another way to rephrase S2.

-- 
Spatialys - Geospatial professional services
http://www.spatialys.com
___
Qgis-developer mailing list
Qgis-developer@lists.osgeo.org
List info: http://lists.osgeo.org/mailman/listinfo/qgis-developer
Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-developer

Re: [Qgis-developer] Interpretation of a 3 point CircularString with p0 == p2 (circle)

2016-06-23 Thread Marco Hugentobler

Hi Even

I agree it will be good to follow the postgres / gdal interpretation. 
Reading S2, I somehow thought the segment midpoint would be the circle 
midpoint, but it's not the same.


Regards,
Marco

On 06/23/16 15:32, Even Rouault wrote:

Hi,

I just came into a difference how QGIS and GDAL interpret a CircularString made
of a 3 points p0, p1, p2 where p0 == p2, which is a way of representing a full
circle.

GDAL interprets p1 as the symetrical point of p0 with respect to the center
(https://github.com/osgeo/gdal/blob/trunk/gdal/ogr/ogrcircularstring.cpp#L640),
that is p1 is on the perimeter of the circle, or said otherwise the center of
the circle is the midpoint of [p0,p1].
Whereas QGIS interprets p1 as the center of the circle (
https://github.com/qgis/QGIS/blob/master/src/core/geometry/qgsgeometryutils.cpp#L359
)

I'd think GDAL interpretation is the right one, since according to
http://jtc1sc32.org/doc/N1101-1150/32N1107-WD13249-3--spatial.pdf (ISO SQL MM
Part 3), paragraph 4.1.6 :
(let's call this sentence S1)
""" In the case where the segment is a circle, then the center is located
at the midpoint of the line connecting the start point with the intermediate
point. """

But if you look a bit above in the paragraph, there's a sentence (call it S2)
: """In the special case where a segment is a complete circle, that is, the
start and end points are coincident, then the intermediate point shall be the
midpoint of the segment. """, which looks confusing at first. I think this
sentence must be interpreted considering distances along the curve, in which
case the "midpoint of the segment" when doing a full walk along the circle
from p0 back to p0 is the symetrical point of p0 with respect to the center.

I think this interpretation is also more logical since, even in that
particular case, p0,p1,p2 are all on the arc, like in the general case.

I can also see that PostGIS (in https://github.com/postgis/postgis/blob/svn-
trunk/liblwgeom/lwalgorithm.c#L252 ) has the same interpretation as GDAL (*)

I'd be happy to read opinions regarding this.

Even

(*) Can also be shown with :

# SELECT
ST_AsText(ST_Envelope(ST_CurveToLine(ST_GeomFromText('CIRCULARSTRING(-1 0,1
0,-1 0)';
   st_astext
--
  POLYGON((-1 -1,-1 1,1 1,1 -1,-1 -1))

And http://postgis.net/docs/manual-2.2/using_postgis_dbmanagement.html says
"The exception to this is for a closed circle, where the start and end points
are the same. In this case the second point MUST be the center of the arc, ie
the opposite side of the circle.", which is another way to rephrase S2.





--
Dr. Marco Hugentobler
Sourcepole -  Linux & Open Source Solutions
Weberstrasse 5, CH-8004 Zürich, Switzerland
marco.hugentob...@sourcepole.ch http://www.sourcepole.ch
Technical Advisor QGIS Project Steering Committee

___
Qgis-developer mailing list
Qgis-developer@lists.osgeo.org
List info: http://lists.osgeo.org/mailman/listinfo/qgis-developer
Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-developer

Re: [Qgis-developer] Problem definig snapping options programmatically

2016-06-23 Thread Matthias Kuhn
Hi Christian,

Does it help if you call

QgsProject.instance().snapSettingsChanged()

Cheers
Matthias

On 06/23/2016 03:38 PM, EFTAS Christian Röttger wrote:
> Hi developers,
> 
>  
> 
> i’m facing a problem which i do not understand. In our plugin I created
> a function to set snapping options and bound it to a shortcut.
> 
> Using Qgis 2.14.3, source code see below.
> 
>  
> 
> The assigned shortcut works well, but for the snapping I have to do the
> following on every QGIS start:
> 
> Go to snapping options, mode = advanced, press ok (without changing
> anything). Then it works afterwards!
> 
> But when I print the options *before* I do this, I definitely get the
> right options (see below).
> 
>  
> 
> Does anyone know what I’m missing? Should I open an bug report? Is there
> a workaround do do: “Go to snapping options, mode = advanced, press ok”
> programmatically ?
> 
>  
> 
> Thanks for any help
> 
> Christian
> 
>  
> 
> ## Print result
> 
> Initialize, when aggroInstance is true
> 
> (True, False, 2, 0, 2.0, True)
> 
> (True, False, 2, 0, 2.0, True)
> 
> (True, False, 2, 0, 2.0, True)
> 
> (True, False, 2, 0, 2.0, True)
> 
> (True, False, 2, 0, 2.0, True)
> 
> (True, False, 2, 0, 2.0, True)
> 
> (True, False, 2, 0, 2.0, True)
> 
> (True, False, 2, 0, 2.0, True)
> 
> checked
> 
> (True, False, 2, 0, 2.0, True)
> 
> (True, False, 2, 0, 2.0, True)
> 
> (True, True, 2, 0, 2.0, False)
> 
> (True, False, 2, 0, 2.0, True)
> 
> (True, False, 2, 0, 2.0, True)
> 
> (True, True, 2, 0, 2.0, False)
> 
> (True, False, 2, 0, 2.0, True)
> 
> (True, False, 2, 0, 2.0, True)
> 
>  
> 
> ## function
> 
>  
> 
> *def *toggleSnapping(checked):
> /'''
> Toggle snapping option
> /*:param*/checked: True if snapping has been activated, False otherwise
> '''
> /aggroInstance = initModule.aggroInstance
> *print **'Initialize'
> **if *bool(agroInstance):
> *for *item *in *QgsMapLayerRegistry.instance().mapLayers().values():
> QgsProject.instance().setSnapSettingsForLayer(item.id(),
> False, 2, 0, 2, True)
> fieldLayer =
> mapUtils.getLayerByName(aggroInstance.dictData[*'field'*])
> backgroundLayer = mapUtils.getLayerByName(*'bg'*)
> *for *item *in *QgsMapLayerRegistry.instance().mapLayers().values():
> *print *QgsProject.instance().snapSettingsForLayer(item.id())
> *if *checked:
> *print **'checked'
> */# Convenience function to set snap settings per layer.
> # it defines the snapping options:
> # id : the id of your layer, True : to enable the layer
> snapping, 2 : options (2: vertex+segment), 0: type of unit on map, 2 :
> tolerance, true : avoidIntersection)
>
> /QgsProject.instance().setSnapSettingsForLayer(fieldLayer.id(), True, 2,
> 0, 2, False)
>
> QgsProject.instance().setSnapSettingsForLayer(backgroundLayer.id(),
> True, 2, 0, 2, False)
> *for *item *in
> *QgsMapLayerRegistry.instance().mapLayers().values():
> *print
> *QgsProject.instance().snapSettingsForLayer(item.id())
> 
>  
> 
> ## initialization in run() method
> 
>  
> 
> /# Call Snapping Tool by a key shortcut
> /*for *action *in *self.actions:
> *if *action.text() == *'Toggle Snapping'*:
> /# Action triggered by shortcut key
> /self.iface.registerMainWindowAction(action, *"c"*)
> 
>  
> 
>  
> 
>  
> 
>  
> 
>  
> 
> --
> 
> image003
> 
> eftas3
> 
> Dipl.-Geoinf. Christian Röttger
> 
> -Forschung und Entwicklung
> 
> E F T A SFernerkundung
> Technologietransfer GmbH
> Oststraße 2-18
> 48145 Münster
> 
> Fon: +49 251 13307-23 E-Mail: christian.roett...@eftas.com
> 
> Fax:  +49 251 13307-33Web:   http://www.eftas.com
> 
> 
> Geschäftsführer:
> Dipl.-Ing. Georg Altrogge
> 
> Sitz der Gesellschaft: Münster
> Amtsgericht Münster, HRB 2999
> USt.-IdNr. DE 126038986
> 
> **
> 
> image007
> 
>  
> 
> 
> 
> ___
> Qgis-developer mailing list
> Qgis-developer@lists.osgeo.org
> List info: http://lists.osgeo.org/mailman/listinfo/qgis-developer
> Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-developer
> 
___
Qgis-developer mailing list
Qgis-developer@lists.osgeo.org
List info: http://lists.osgeo.org/mailman/listinfo/qgis-developer
Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-developer

[Qgis-developer] Problem definig snapping options programmatically

2016-06-23 Thread EFTAS Christian Röttger
Hi developers,

i'm facing a problem which i do not understand. In our plugin I created a 
function to set snapping options and bound it to a shortcut.
Using Qgis 2.14.3, source code see below.

The assigned shortcut works well, but for the snapping I have to do the 
following on every QGIS start:
Go to snapping options, mode = advanced, press ok (without changing anything). 
Then it works afterwards!
But when I print the options before I do this, I definitely get the right 
options (see below).

Does anyone know what I'm missing? Should I open an bug report? Is there a 
workaround do do: "Go to snapping options, mode = advanced, press ok" 
programmatically ?

Thanks for any help
Christian

## Print result
Initialize, when aggroInstance is true
(True, False, 2, 0, 2.0, True)
(True, False, 2, 0, 2.0, True)
(True, False, 2, 0, 2.0, True)
(True, False, 2, 0, 2.0, True)
(True, False, 2, 0, 2.0, True)
(True, False, 2, 0, 2.0, True)
(True, False, 2, 0, 2.0, True)
(True, False, 2, 0, 2.0, True)
checked
(True, False, 2, 0, 2.0, True)
(True, False, 2, 0, 2.0, True)
(True, True, 2, 0, 2.0, False)
(True, False, 2, 0, 2.0, True)
(True, False, 2, 0, 2.0, True)
(True, True, 2, 0, 2.0, False)
(True, False, 2, 0, 2.0, True)
(True, False, 2, 0, 2.0, True)

## function

def toggleSnapping(checked):
'''
Toggle snapping option
:param checked: True if snapping has been activated, False otherwise
'''
aggroInstance = initModule.aggroInstance
print 'Initialize'
if bool(agroInstance):
for item in QgsMapLayerRegistry.instance().mapLayers().values():
QgsProject.instance().setSnapSettingsForLayer(item.id(), False, 2, 
0, 2, True)
fieldLayer = mapUtils.getLayerByName(aggroInstance.dictData['field'])
backgroundLayer = mapUtils.getLayerByName('bg')
for item in QgsMapLayerRegistry.instance().mapLayers().values():
print QgsProject.instance().snapSettingsForLayer(item.id())
if checked:
print 'checked'
# Convenience function to set snap settings per layer.
# it defines the snapping options:
# id : the id of your layer, True : to enable the layer snapping, 2 
: options (2: vertex+segment), 0: type of unit on map, 2 : tolerance, true : 
avoidIntersection)
QgsProject.instance().setSnapSettingsForLayer(fieldLayer.id(), 
True, 2, 0, 2, False)
QgsProject.instance().setSnapSettingsForLayer(backgroundLayer.id(), 
True, 2, 0, 2, False)
for item in QgsMapLayerRegistry.instance().mapLayers().values():
print QgsProject.instance().snapSettingsForLayer(item.id())


## initialization in run() method


# Call Snapping Tool by a key shortcut
for action in self.actions:
if action.text() == 'Toggle Snapping':
# Action triggered by shortcut key
self.iface.registerMainWindowAction(action, "c")





--

[eftas3]
Dipl.-Geoinf. Christian Röttger
-Forschung und Entwicklung
E F T A SFernerkundung
Technologietransfer GmbH
Oststraße 2-18
48145 Münster
Fon: +49 251 13307-23 E-Mail: 
christian.roett...@eftas.com
Fax:  +49 251 13307-33Web:   http://www.eftas.com
Geschäftsführer:
Dipl.-Ing. Georg Altrogge

Sitz der Gesellschaft: Münster
Amtsgericht Münster, HRB 2999
USt.-IdNr. DE 126038986
**
[image007]

___
Qgis-developer mailing list
Qgis-developer@lists.osgeo.org
List info: http://lists.osgeo.org/mailman/listinfo/qgis-developer
Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-developer

Re: [Qgis-developer] Interpretation of a 3 point CircularString with p0 == p2 (circle)

2016-06-23 Thread G. Allegri
Hi Even,
this difference catched my eye too. I think SQL MM (and consequently GDAL
and PostGIS) interpration is more logical, and I would suggest QGIS should
follow it too.

Giovanni

2016-06-23 15:32 GMT+02:00 Even Rouault :

> Hi,
>
> I just came into a difference how QGIS and GDAL interpret a CircularString
> made
> of a 3 points p0, p1, p2 where p0 == p2, which is a way of representing a
> full
> circle.
>
> GDAL interprets p1 as the symetrical point of p0 with respect to the center
> (
> https://github.com/osgeo/gdal/blob/trunk/gdal/ogr/ogrcircularstring.cpp#L640
> ),
> that is p1 is on the perimeter of the circle, or said otherwise the center
> of
> the circle is the midpoint of [p0,p1].
> Whereas QGIS interprets p1 as the center of the circle (
>
> https://github.com/qgis/QGIS/blob/master/src/core/geometry/qgsgeometryutils.cpp#L359
> )
>
> I'd think GDAL interpretation is the right one, since according to
> http://jtc1sc32.org/doc/N1101-1150/32N1107-WD13249-3--spatial.pdf (ISO
> SQL MM
> Part 3), paragraph 4.1.6 :
> (let's call this sentence S1)
> """ In the case where the segment is a circle, then the center is located
> at the midpoint of the line connecting the start point with the
> intermediate
> point. """
>
> But if you look a bit above in the paragraph, there's a sentence (call it
> S2)
> : """In the special case where a segment is a complete circle, that is, the
> start and end points are coincident, then the intermediate point shall be
> the
> midpoint of the segment. """, which looks confusing at first. I think this
> sentence must be interpreted considering distances along the curve, in
> which
> case the "midpoint of the segment" when doing a full walk along the circle
> from p0 back to p0 is the symetrical point of p0 with respect to the
> center.
>
> I think this interpretation is also more logical since, even in that
> particular case, p0,p1,p2 are all on the arc, like in the general case.
>
> I can also see that PostGIS (in
> https://github.com/postgis/postgis/blob/svn-
> trunk/liblwgeom/lwalgorithm.c#L252 ) has the same interpretation as GDAL
> (*)
>
> I'd be happy to read opinions regarding this.
>
> Even
>
> (*) Can also be shown with :
>
> # SELECT
> ST_AsText(ST_Envelope(ST_CurveToLine(ST_GeomFromText('CIRCULARSTRING(-1 0,1
> 0,-1 0)';
>   st_astext
> --
>  POLYGON((-1 -1,-1 1,1 1,1 -1,-1 -1))
>
> And http://postgis.net/docs/manual-2.2/using_postgis_dbmanagement.html
> says
> "The exception to this is for a closed circle, where the start and end
> points
> are the same. In this case the second point MUST be the center of the arc,
> ie
> the opposite side of the circle.", which is another way to rephrase S2.
>
>
> --
> Spatialys - Geospatial professional services
> http://www.spatialys.com
> ___
> Qgis-developer mailing list
> Qgis-developer@lists.osgeo.org
> List info: http://lists.osgeo.org/mailman/listinfo/qgis-developer
> Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-developer
___
Qgis-developer mailing list
Qgis-developer@lists.osgeo.org
List info: http://lists.osgeo.org/mailman/listinfo/qgis-developer
Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-developer

[Qgis-developer] Interpretation of a 3 point CircularString with p0 == p2 (circle)

2016-06-23 Thread Even Rouault
Hi,

I just came into a difference how QGIS and GDAL interpret a CircularString made 
of a 3 points p0, p1, p2 where p0 == p2, which is a way of representing a full 
circle.

GDAL interprets p1 as the symetrical point of p0 with respect to the center
(https://github.com/osgeo/gdal/blob/trunk/gdal/ogr/ogrcircularstring.cpp#L640), 
that is p1 is on the perimeter of the circle, or said otherwise the center of 
the circle is the midpoint of [p0,p1].
Whereas QGIS interprets p1 as the center of the circle ( 
https://github.com/qgis/QGIS/blob/master/src/core/geometry/qgsgeometryutils.cpp#L359
 
)

I'd think GDAL interpretation is the right one, since according to 
http://jtc1sc32.org/doc/N1101-1150/32N1107-WD13249-3--spatial.pdf (ISO SQL MM 
Part 3), paragraph 4.1.6 :
(let's call this sentence S1)
""" In the case where the segment is a circle, then the center is located 
at the midpoint of the line connecting the start point with the intermediate 
point. """

But if you look a bit above in the paragraph, there's a sentence (call it S2) 
: """In the special case where a segment is a complete circle, that is, the 
start and end points are coincident, then the intermediate point shall be the 
midpoint of the segment. """, which looks confusing at first. I think this 
sentence must be interpreted considering distances along the curve, in which 
case the "midpoint of the segment" when doing a full walk along the circle 
from p0 back to p0 is the symetrical point of p0 with respect to the center.

I think this interpretation is also more logical since, even in that 
particular case, p0,p1,p2 are all on the arc, like in the general case.

I can also see that PostGIS (in https://github.com/postgis/postgis/blob/svn-
trunk/liblwgeom/lwalgorithm.c#L252 ) has the same interpretation as GDAL (*)

I'd be happy to read opinions regarding this.

Even

(*) Can also be shown with :

# SELECT 
ST_AsText(ST_Envelope(ST_CurveToLine(ST_GeomFromText('CIRCULARSTRING(-1 0,1 
0,-1 0)';
  st_astext   
--
 POLYGON((-1 -1,-1 1,1 1,1 -1,-1 -1))

And http://postgis.net/docs/manual-2.2/using_postgis_dbmanagement.html says 
"The exception to this is for a closed circle, where the start and end points 
are the same. In this case the second point MUST be the center of the arc, ie 
the opposite side of the circle.", which is another way to rephrase S2.


-- 
Spatialys - Geospatial professional services
http://www.spatialys.com
___
Qgis-developer mailing list
Qgis-developer@lists.osgeo.org
List info: http://lists.osgeo.org/mailman/listinfo/qgis-developer
Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-developer

Re: [Qgis-developer] Segmentation fault when using layersRemoved SIGNAL.

2016-06-23 Thread René-Luc Dhont

Thanks to open the issue.

We encountered the same behavoir on QGIS Server.

The crash is due to `QgsEditorWidgetRegistry::mapLayerWillBeRemoved` 
when the cast is done `QgsVectorLayer* vl = 
qobject_cast( mapLayer );` QGIS crashed.


Some one to fix it ?

Le 20/06/2016 17:54, Germán Carrillo a écrit :
For reference, this is the ticket I've just opened: 
http://hub.qgis.org/issues/15088


Regards,

Germán

2016-06-18 5:56 GMT-05:00 René-Luc Dhont >:


Open a ticket with your code example.

Regards,


Le 18/06/2016 00:28, Germán Carrillo a écrit :

Should I open a ticket reporting this issue to the QGIS issue
tracker?

Regards,

Germán

2016-06-13 15:53 GMT-05:00 Germán Carrillo
>:

Hi All,

there seems to be an issue connecting the SIGNAL
layersRemoved from QgsMapLayerRegistry.

For example, if I save this script to a file, and run it from
the Linux terminal:


import unittest
from qgis.core import QgsApplication, QgsMapLayerRegistry

class SIGNALTest( unittest.TestCase ):

def setUp( self ):
app = QgsApplication([], True)
QgsApplication.setPrefixPath("/usr", True)
QgsApplication.initQgis()
QgsMapLayerRegistry.instance().layersRemoved.connect(
self.myFunction )
def myFunction( self, layerIds ):
print "Called!"
def test1( self ):
self.assertEqual(1,1)

def tearDown( self ):
QgsApplication.exitQgis()
if __name__ == "__main__":
unittest.main()


I get the following result:

##
Called!
.
--
Ran 1 test in 0.119s

OK
Segmentation fault
###

If, on the contrary, I comment out the line where the
connection is set or if I use other signals such as
layerRemoved or layersAdded instead of layersRemoved, I get:

###
.
--
Ran 1 test in 0.111s

OK
###

I'm using QGIS 2.14.2 on a GNU/Linux machine.

Can you confirm such problem? Do you have any clue about it?


Regards,

Germán

-- 
---

   |\__
(:>__)(
   |/
Soluciones Geoinformáticas Libres
http://geotux.tuxfamily.org/
http://twitter.com/GeoTux2
http://about.me/germancarrillo






-- 
---

   |\__
(:>__)(
   |/
Soluciones Geoinformáticas Libres
http://geotux.tuxfamily.org/
http://twitter.com/GeoTux2
http://about.me/germancarrillo




___
Qgis-developer mailing list
Qgis-developer@lists.osgeo.org

List info:http://lists.osgeo.org/mailman/listinfo/qgis-developer
Unsubscribe:http://lists.osgeo.org/mailman/listinfo/qgis-developer



___
Qgis-developer mailing list
Qgis-developer@lists.osgeo.org 
List info: http://lists.osgeo.org/mailman/listinfo/qgis-developer
Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-developer




--
---
   |\__
(:>__)(
   |/
Soluciones Geoinformáticas Libres
http://geotux.tuxfamily.org/
http://twitter.com/GeoTux2
http://about.me/germancarrillo




___
Qgis-developer mailing list
Qgis-developer@lists.osgeo.org
List info: http://lists.osgeo.org/mailman/listinfo/qgis-developer
Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-developer


___
Qgis-developer mailing list
Qgis-developer@lists.osgeo.org
List info: http://lists.osgeo.org/mailman/listinfo/qgis-developer
Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-developer

Re: [Qgis-developer] Add Layers to spatialite database

2016-06-23 Thread Luis Miguel Royo Perez
Hi! Thanks for the reply, yes!! I have just tried and it's working 
properly!!


Thanks!!

El 23/06/16 a las 12:15, G. Allegri escribió:

k to QgsVectorLayerImport [1] which DB Manager uses [2


___
Qgis-developer mailing list
Qgis-developer@lists.osgeo.org
List info: http://lists.osgeo.org/mailman/listinfo/qgis-developer
Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-developer

Re: [Qgis-developer] Add Layers to spatialite database

2016-06-23 Thread G. Allegri
Have you given a look to QgsVectorLayerImport [1] which DB Manager uses [2]
at the end?

giovanni

[1] http://qgis.org/api/2.14/classQgsVectorLayerImport.html
[2]
https://github.com/qgis/QGIS/blob/master/python/plugins/db_manager/dlg_import_vector.py#L334

2016-06-23 11:52 GMT+02:00 Tom Chadwin :

> Is spatialite_tool an option?
>
> http://www.gaia-gis.it/gaia-sins/spatialite-cookbook/html/impexp.html
>
> Caveat: not tried personally - just passing on possible solution.
>
> Tom
>
>
>
> --
> View this message in context:
> http://osgeo-org.1560.x6.nabble.com/Add-Layers-to-spatialite-database-tp5272527p5272972.html
> Sent from the Quantum GIS - Developer mailing list archive at Nabble.com.
> ___
> Qgis-developer mailing list
> Qgis-developer@lists.osgeo.org
> List info: http://lists.osgeo.org/mailman/listinfo/qgis-developer
> Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-developer
___
Qgis-developer mailing list
Qgis-developer@lists.osgeo.org
List info: http://lists.osgeo.org/mailman/listinfo/qgis-developer
Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-developer

Re: [Qgis-developer] Add Layers to spatialite database

2016-06-23 Thread Tom Chadwin
Is spatialite_tool an option?

http://www.gaia-gis.it/gaia-sins/spatialite-cookbook/html/impexp.html

Caveat: not tried personally - just passing on possible solution.

Tom



--
View this message in context: 
http://osgeo-org.1560.x6.nabble.com/Add-Layers-to-spatialite-database-tp5272527p5272972.html
Sent from the Quantum GIS - Developer mailing list archive at Nabble.com.
___
Qgis-developer mailing list
Qgis-developer@lists.osgeo.org
List info: http://lists.osgeo.org/mailman/listinfo/qgis-developer
Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-developer

Re: [Qgis-developer] custom charts?

2016-06-23 Thread Hugo Mercier
On 22/06/2016 19:06, Richard Duivenvoorde wrote:
> On 22-06-16 14:39, Hugo Mercier wrote:
>> Hi Raymond,
>>> - Add a text field to my feature layer containig svg, and somehow make
>>> qgis display that on my map;
>>
>> This should work, no ?
> 
> Are you sure? This would mean that the value(!) of an attribute would
> contain the actual svg (code, not filename).
> Any example on how to use that with styling then?

Hmmm exact, I don't think you can include the content (I tried to
include a data url but it does not work).

> 
>>> - Add a text field to my feature layer containig a path to a png (or
>>> svg), and somehow make qgis display that on my map.
>>
>> An SVG marker with the file name defined as an expression ?
> 
> Same here, while we managed to get for example colors dynamic, we could
> not find a way (yet) to set the marker-svg once filename is retrieved
> from an attribute...
> 
> Happy to get an example or pointers :-)

with an SVG-marker the filename can be "data-defined", so you can for
instance use an expression like '/xxx/mymarker_' || id || '.svg'


___
Qgis-developer mailing list
Qgis-developer@lists.osgeo.org
List info: http://lists.osgeo.org/mailman/listinfo/qgis-developer
Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-developer