Re: [Qgis-developer] Changing folder of plugin install

2015-12-03 Thread Rémi Cura
Sorry,
after a long time,
I destructed and recreated the plugin.
It is currently awaiting check, it has not changed since the last time,
expect the folder name is now the same as the plugin name.

Cheers,
RémiC

2015-05-30 16:58 GMT+02:00 Rémi Cura :

> Thanks to both !
> I'll delete and create again the plugin.
> Cheers,
> Rémi-C
>
> 2015-05-30 12:59 GMT+02:00 Borys Jurgiel :
>
>> Strictly speaking, there are two separate problems:
>>
>> One is the name mismatch, what makes QGIS thinking that the zip available
>> in
>> the repo ("interactive_map_tracking") and the installed plugin
>> ("interactive_map_tracking-master") are two separate plugins. As a result,
>> QGIS won't inform the user about available updates.
>>
>> Second problem is bigger: the directory is just a Python module, and it
>> crashes Python, because module names can't contain dashes. It's a Python
>> syntax restriction, not QGIS. And, as Alessandro said, this is the plugin
>> key,
>> not the zip file name (what is basically much less important) so changing
>> it
>> would be quite complicated.
>>
>> Hopefully removing the plugin and creating again will be straightforward.
>>
>> Best Regards,
>>
>> Borys
>>
>>
>>
>> Dnia piątek, 29 maja 2015 15:34:16 Rémi Cura pisze:
>> > I'm afraid I can't,
>> > currently it creates a bug !
>> > When installing from QGIS plugin repository,
>> > it gives an error message.
>> > This error message would be because the plugin name and folder name are
>> > different.
>> > So one way or another, the folder name has to be changed to match the
>> > plugin name !
>> >
>> > So you see we don't have much choice here...
>> > Cheers,
>> > Rémi-C
>> >
>> > 2015-05-29 15:17 GMT+02:00 Alessandro Pasotti :
>> > > 2015-05-29 14:52 GMT+02:00 Rémi Cura :
>> > >> Hey, thanks for the super-quick answer.
>> > >>
>> > >> Can't we just change the plugin database for this plugin?
>> > >> Surely there is a way to do it manually !
>> > >
>> > > Yes, but it's not trivial.
>> > >
>> > >> Or simply change the folder name on the server?
>> > >> Deleting the plugin make it loose all the history, which I find quit
>> bad.
>> > >>
>> > >> Also, if the consequences are so dire, wouldn't is be necessary to
>> check
>> > >> at import that plugin name and folder name match?
>> > >
>> > > Sorry for the quick (and wrong) answer :)
>> > >
>> > > I checked the exact constraint:  the package name (the name of the
>> fist
>> > > folder in the zip file) is independent from the plugins name and
>> cannot be
>> > > changed (while the plugin name, visible to the user, can change) the
>> > > package name is a unique key used internally to build the URLs and to
>> > > retrieve plugin packages and is kept unique to make sure that there
>> are no
>> > > plugins with the same package name.
>> > >
>> > > The problem here is that it cannot be easily changed without breaking
>> a
>> > > lot of things.
>> > >
>> > > You can just stick with the old package/folder name, it will be just
>> > > visible in the URLs.
>> > >
>> > >
>> > > --
>> > > Alessandro Pasotti
>> > > w3:   www.itopen.it
>>
>>
>
___
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] adding to Bug report #10298

2015-12-02 Thread Rémi Cura
Hey,
A small complement, as I'm not able to add to the ticket.

Issue still present with 2.12.
It seems the whole proxy stuff is ot taken into account before a restart.

We would really need a small button in the proxy tab to test the connection
(for instance trying to reach qgis web site),
similarly to what exists when adding a postgres connection.

Cheers,
Rémi C
___
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] 2.6 strange behaviour with editing boolean field using checkbox + postgis

2015-08-28 Thread Rémi Cura
Hey,
some strange behaviour here (2.6) :

In a postgis layer over a postgis view
one of the view field is a boolean

I chose the checkbox for editing this field.
checked is "true", unchecked is "false" , without the quote signs.

When adding a new geometry, all works as intended, the row inserted into
the database is the correct one.

But when trying to get info about the geometry (arrow with the question
mark), it generates an error :

1 cursor states lost.

SQL:

DECLARE qgis_12 BINARY CURSOR FOR

SELECT st_asbinary("geom",'NDR')

   ,boolout("positionning_absolute")

   ,"gid"::text

   ,"type"::text

   ,"positionning_offset_type"::text

   ,"positionning_offset"::text

   ,"positionning_orientation_type"::text

   ,"positionning_orientation"::text

   ,"curv_dist"::text

FROM "street_amp"."editing_street_object"

WHERE boolout("positionning_absolute")='t'


Résultat: 7 (

ERROR: operator does not exist: cstring = unknown

LINE 1: ...ng_street_object" WHERE boolout("positionning_absolute")='t'

^

HINT: No operator matches the given name and argument type(s). You might
need to add explicit type casts.

)


I don't understand the need to use the boolout function,

it works simply without it, and if you want to be extra sure,

you could cast the text to boolean safely (it is not necessary tough)


FROM "street_amp"."editing_street_object"

WHERE "positionning_absolute"='t'::boolean


Cheers,

Rémi-C
___
Qgis-developer mailing list
Qgis-developer@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/qgis-developer

Re: [Qgis-developer] Changing folder of plugin install

2015-05-30 Thread Rémi Cura
Thanks to both !
I'll delete and create again the plugin.
Cheers,
Rémi-C

2015-05-30 12:59 GMT+02:00 Borys Jurgiel :

> Strictly speaking, there are two separate problems:
>
> One is the name mismatch, what makes QGIS thinking that the zip available
> in
> the repo ("interactive_map_tracking") and the installed plugin
> ("interactive_map_tracking-master") are two separate plugins. As a result,
> QGIS won't inform the user about available updates.
>
> Second problem is bigger: the directory is just a Python module, and it
> crashes Python, because module names can't contain dashes. It's a Python
> syntax restriction, not QGIS. And, as Alessandro said, this is the plugin
> key,
> not the zip file name (what is basically much less important) so changing
> it
> would be quite complicated.
>
> Hopefully removing the plugin and creating again will be straightforward.
>
> Best Regards,
>
> Borys
>
>
>
> Dnia piątek, 29 maja 2015 15:34:16 Rémi Cura pisze:
> > I'm afraid I can't,
> > currently it creates a bug !
> > When installing from QGIS plugin repository,
> > it gives an error message.
> > This error message would be because the plugin name and folder name are
> > different.
> > So one way or another, the folder name has to be changed to match the
> > plugin name !
> >
> > So you see we don't have much choice here...
> > Cheers,
> > Rémi-C
> >
> > 2015-05-29 15:17 GMT+02:00 Alessandro Pasotti :
> > > 2015-05-29 14:52 GMT+02:00 Rémi Cura :
> > >> Hey, thanks for the super-quick answer.
> > >>
> > >> Can't we just change the plugin database for this plugin?
> > >> Surely there is a way to do it manually !
> > >
> > > Yes, but it's not trivial.
> > >
> > >> Or simply change the folder name on the server?
> > >> Deleting the plugin make it loose all the history, which I find quit
> bad.
> > >>
> > >> Also, if the consequences are so dire, wouldn't is be necessary to
> check
> > >> at import that plugin name and folder name match?
> > >
> > > Sorry for the quick (and wrong) answer :)
> > >
> > > I checked the exact constraint:  the package name (the name of the fist
> > > folder in the zip file) is independent from the plugins name and
> cannot be
> > > changed (while the plugin name, visible to the user, can change) the
> > > package name is a unique key used internally to build the URLs and to
> > > retrieve plugin packages and is kept unique to make sure that there
> are no
> > > plugins with the same package name.
> > >
> > > The problem here is that it cannot be easily changed without breaking a
> > > lot of things.
> > >
> > > You can just stick with the old package/folder name, it will be just
> > > visible in the URLs.
> > >
> > >
> > > --
> > > Alessandro Pasotti
> > > w3:   www.itopen.it
>
>
___
Qgis-developer mailing list
Qgis-developer@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/qgis-developer

Re: [Qgis-developer] Changing folder of plugin install

2015-05-29 Thread Rémi Cura
I'm afraid I can't,
currently it creates a bug !
When installing from QGIS plugin repository,
it gives an error message.
This error message would be because the plugin name and folder name are
different.
So one way or another, the folder name has to be changed to match the
plugin name !

So you see we don't have much choice here...
Cheers,
Rémi-C

2015-05-29 15:17 GMT+02:00 Alessandro Pasotti :

> 2015-05-29 14:52 GMT+02:00 Rémi Cura :
>
>> Hey, thanks for the super-quick answer.
>>
>> Can't we just change the plugin database for this plugin?
>> Surely there is a way to do it manually !
>>
>
> Yes, but it's not trivial.
>
>
>> Or simply change the folder name on the server?
>> Deleting the plugin make it loose all the history, which I find quit bad.
>>
>> Also, if the consequences are so dire, wouldn't is be necessary to check
>> at import that plugin name and folder name match?
>>
>
> Sorry for the quick (and wrong) answer :)
>
> I checked the exact constraint:  the package name (the name of the fist
> folder in the zip file) is independent from the plugins name and cannot be
> changed (while the plugin name, visible to the user, can change) the
> package name is a unique key used internally to build the URLs and to
> retrieve plugin packages and is kept unique to make sure that there are no
> plugins with the same package name.
>
> The problem here is that it cannot be easily changed without breaking a
> lot of things.
>
> You can just stick with the old package/folder name, it will be just
> visible in the URLs.
>
>
> --
> Alessandro Pasotti
> w3:   www.itopen.it
>
___
Qgis-developer mailing list
Qgis-developer@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/qgis-developer

Re: [Qgis-developer] Changing folder of plugin install

2015-05-29 Thread Rémi Cura
Hey, thanks for the super-quick answer.

Can't we just change the plugin database for this plugin?
Surely there is a way to do it manually !
Or simply change the folder name on the server?
Deleting the plugin make it loose all the history, which I find quit bad.

Also, if the consequences are so dire, wouldn't is be necessary to check at
import that plugin name and folder name match?

Cheers,
Rémi-C

2015-05-29 13:55 GMT+02:00 Alessandro Pasotti :

> Hi,
>
> The only option I see is to delete the plugin that was created with a
> wrong package name and create a new one with the right package name.
>
> Plugin name and folder name must match.
>
>
>
>
> 2015-05-29 13:47 GMT+02:00 Rémi Cura :
>
>> Hey,
>> we have a problem with our plugin
>> <http://plugins.qgis.org/plugins/interactive_map_tracking-master>,
>> QGIS gives a wrong error message at first install.
>>
>> Apparently this is due to the fact that our plugin is in a folder called
>> 'interactive_map_tracking-master'
>> and the plugin name is 'interactive_map_tracking'
>>
>> I tried to update the plugin by sending a new zip containing the correct
>> folder name, but it is blocked by the site
>> "Plugin name mismatch: the plugin main folder name in the compressed file
>> (interactive_map_tracking) is different from the original plugin package
>> name (interactive_map_tracking-master)."
>>
>> I don't see any contact form on the plugin web site,
>> could somebody un-stuck us please?
>>
>> Thanks,
>> Rémi-C
>>
>> ___
>> Qgis-developer mailing list
>> Qgis-developer@lists.osgeo.org
>> http://lists.osgeo.org/mailman/listinfo/qgis-developer
>>
>
>
>
> --
> Alessandro Pasotti
> w3:   www.itopen.it
>
___
Qgis-developer mailing list
Qgis-developer@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/qgis-developer

[Qgis-developer] Changing folder of plugin install

2015-05-29 Thread Rémi Cura
Hey,
we have a problem with our plugin
,
QGIS gives a wrong error message at first install.

Apparently this is due to the fact that our plugin is in a folder called
'interactive_map_tracking-master'
and the plugin name is 'interactive_map_tracking'

I tried to update the plugin by sending a new zip containing the correct
folder name, but it is blocked by the site
"Plugin name mismatch: the plugin main folder name in the compressed file
(interactive_map_tracking) is different from the original plugin package
name (interactive_map_tracking-master)."

I don't see any contact form on the plugin web site,
could somebody un-stuck us please?

Thanks,
Rémi-C
___
Qgis-developer mailing list
Qgis-developer@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/qgis-developer

Re: [Qgis-developer] Grouping insert/update when sending to PostGIS

2015-05-28 Thread Rémi Cura
Hey Jürgen,
this doesn't explain why each operations isn't grouped.


For instance all the addFeatures are grouped into one transaction, but not
into one statement.
Cheers,

Rémi-C

2015-05-28 16:39 GMT+02:00 Jürgen E. :

> Hi Rémi,
>
> On Thu, 28. May 2015 at 12:06:22 +0200, Rémi Cura wrote:
> > When making several edit on the layer, then saving the edits.
> > All the edits are send one by one to the database (though in the same
> > transaction).
>
> That's because of the provider interface.  For vector data providers
> addFeatures, deleteFeatures, changeAttributeValues and
> changeGeometryValues are
> independant operations - which therefore are also done in separate
> transactions.
>
>
> Jürgen
>
> --
> Jürgen E. Fischer   norBIT GmbH Tel. +49-4931-918175-31
> Dipl.-Inf. (FH) Rheinstraße 13  Fax. +49-4931-918175-50
> Software Engineer   D-26506 Norden
> http://www.norbit.de
> QGIS release manager (PSC)  GermanyIRC: jef on FreeNode
>
> ___
> Qgis-developer mailing list
> Qgis-developer@lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/qgis-developer
>
___
Qgis-developer mailing list
Qgis-developer@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/qgis-developer

[Qgis-developer] Grouping insert/update when sending to PostGIS

2015-05-28 Thread Rémi Cura
Hey dear list,

I recently stumbled upon a strange behaviour of QGIS.

With a simple point postgis layer.

When making several edit on the layer, then saving the edits.
All the edits are send one by one to the database (though in the same
transaction).

It would hold much benefits to group those insert/update per table before
sending it, and it may be easy to do.

A pure SQL solution :
instead of doing for instance :
-
--adding stuff
INSERT INTO my_table (geom) VALUES ('POINT(1,2)');
INSERT INTO my_table (geom) VALUES ('POINT(3,4)');
--updating stuff
UPDATE my_table SET geom = 'POINT(5,6)' WHERE id = 1 ;
UPDATE my_table SET geom = 'POINT(7,8)' WHERE id = 2 ;
--deleting stuff
DELETE FROM my_table WHERE id = 3 ;
DELETE FROM my_table WHERE id = 4 ;
--

We could do
--
WITH inserting AS (
INSERT INTO my_table (geom) VALUES ('POINT(1,2)')
)
,to_update AS (
SELECT 1 AS id, 'POINT(5,6)' AS geom
UNION ALL
SELECT 2 , 'POINT(7,8)'
)
, updating AS (
UPDATE my_table SET geom = t_o.geom
FROM update AS t_o
WHERE my_table.id = t_o.id
RETURNING 1
)
, deleting AS (
DELETE FROM my_table
WHERE id = ANY (ARRAY[3,4])
RETURNING 1
)
SELECT 1
FROM deleting ;



Speed may benefit from it, but much more important, all the action would be
in one statement, which would permit to use STATEMENT TRIGGER in postgis
database.

Cheers,
Rémi-C
___
Qgis-developer mailing list
Qgis-developer@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/qgis-developer

Re: [Qgis-developer] Plugin to synchronize an attribute table between QGIS and LibreOffice?

2015-04-26 Thread Rémi Cura
Hey,
you could use SQLite as an itermediary.
As far as I know, QGIS can natively read/write into SQLite tables, and use
it anyway.
And as far as I know, Open Office can easily read and write data in/from
SQLIte.

It would be very close to what you want, without the need to write a QGIS
extension.
You would just have to write the LibreOffice plugin

Cheers,
Rémi-C

2015-04-25 22:07 GMT+02:00 Stefan Keller :

> Hi Vaclav
>
> Thanks for the hint.
> Interesting talk about Geodesign (which to me is a synonym decision
> support) and open source tools like PostGIS, QGIS and LibreOffice.
> But there, QGIS is connected to LibreOffice via PostgreSQL/PostGIS.
> I'm looking for a direct connection between QGIS and LibreOffice calc.
>
> -S.
>
>
> 2015-04-25 18:43 GMT+02:00 Vaclav Petras :
> >
> > On Sat, Apr 25, 2015 at 11:49 AM, Stefan Keller 
> wrote:
> >>
> >> What about a plugin to open and synchronize an attribute table between
> >> QGIS and LibreOffice?
> >
> > There was a talk at FOSS4G PDX 2014 which described combination of
> > PostGIS/PostgreSQL+QGIS+LibreOffice:
> >
> > Geodesign: An Introduction to Design with Geography — Matthew Baker,
> Denver
> > Public Schools, Critter Thompson, Placematters
> > https://vimeo.com/106233274
> > 5:00-15:00
> >
> >> This would also require to write a LibreOffice extension.
> >> As an inspiration see this ArcGIS extension called "gisconnector" [1]
> >>
> >> --S.
> >>
> >> [1]
> >>
> http://www.gislounge.com/gisconnector-excel-synchronize-data-selections-filters-arcgis-excel/
> >> ___
> >> Qgis-developer mailing list
> >> Qgis-developer@lists.osgeo.org
> >> http://lists.osgeo.org/mailman/listinfo/qgis-developer
> >
> ___
> Qgis-developer mailing list
> Qgis-developer@lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/qgis-developer
>
___
Qgis-developer mailing list
Qgis-developer@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/qgis-developer

Re: [Qgis-developer] [Qgis-user] accessing a web page from within a plug-in

2015-03-06 Thread Rémi Cura
It turns out you were completely right.
Your answer definitively gives a way to use the proxy setted in QGIS.
Thanks again,
Rémi-C

2015-03-03 15:38 GMT+01:00 Rémi Cura :

> Thank you very much.
> It seems that strangely enough,
> using  `QWebView` automatically takes into account the qgis proxy settings.
>
> For the check of connection, it was actually a lot more complicated that
> we thought.
> The complexity comes from the fact that all QT web querry are asynchronous.
>
> We put a state machine to switch between local and online version when
> there is/there is no connexion.
>
> Many thanks for your help.
>
> Cheers,
> Rémi-C
>
> 2015-03-02 18:46 GMT+01:00 Enrico Ferreguti :
>
>>
>> http://stackoverflow.com/questions/23041066/setting-proxy-parameter-in-qgis-plugins-how-to
>>
>> The only problem is the url exclusions is not implemented in qt class.
>> Regards
>>
>> Enrico ferreguti
>> --
>> Da: Rémi Cura 
>> Inviato: ‎02/‎03/‎2015 18:20
>> A: qgis-developer ;
>> qgis-u...@lists.osgeo.org
>> Oggetto: [Qgis-user] accessing a web page from within a plug-in
>>
>> Hey dear Qgis list,
>>
>> my question is related to network and plugin.
>>
>> From within our plugin
>> <http://remi-c.github.io/interactive_map_tracking/> we would like to
>> display a User Guide
>> <https://github.com/Remi-C/interactive_map_tracking/wiki/%5BUser%5D-User-Guide-%28simplified%29>
>> .
>> This guide already exists on GitHub, and it would be good to directly
>> display the html fo the github page in the plugin.
>>
>>
>> Of course internet is not always accessible, so we have a local version
>> of html pages in the plugin directory.
>>
>> SO there is 2 questions :
>> - Are we sure that using the `QWebView` to connect to internet will
>> include the QGIS proxy settings? (what is the best practice here?)
>> - How to check if it is possible to access an internet page, so that if
>> it is not possible to get the online version, we could fall back on the
>> local version?
>>
>> Thanks for your time ,
>> Cheers,
>> Rémi-C
>>
>
>
___
Qgis-developer mailing list
Qgis-developer@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/qgis-developer

Re: [Qgis-developer] [Qgis-user] accessing a web page from within a plug-in

2015-03-03 Thread Rémi Cura
Thank you very much.
It seems that strangely enough,
using  `QWebView` automatically takes into account the qgis proxy settings.

For the check of connection, it was actually a lot more complicated that we
thought.
The complexity comes from the fact that all QT web querry are asynchronous.

We put a state machine to switch between local and online version when
there is/there is no connexion.

Many thanks for your help.

Cheers,
Rémi-C

2015-03-02 18:46 GMT+01:00 Enrico Ferreguti :

>
> http://stackoverflow.com/questions/23041066/setting-proxy-parameter-in-qgis-plugins-how-to
>
> The only problem is the url exclusions is not implemented in qt class.
> Regards
>
> Enrico ferreguti
> --
> Da: Rémi Cura 
> Inviato: ‎02/‎03/‎2015 18:20
> A: qgis-developer ;
> qgis-u...@lists.osgeo.org
> Oggetto: [Qgis-user] accessing a web page from within a plug-in
>
> Hey dear Qgis list,
>
> my question is related to network and plugin.
>
> From within our plugin <http://remi-c.github.io/interactive_map_tracking/>
> we would like to display a User Guide
> <https://github.com/Remi-C/interactive_map_tracking/wiki/%5BUser%5D-User-Guide-%28simplified%29>
> .
> This guide already exists on GitHub, and it would be good to directly
> display the html fo the github page in the plugin.
>
>
> Of course internet is not always accessible, so we have a local version of
> html pages in the plugin directory.
>
> SO there is 2 questions :
> - Are we sure that using the `QWebView` to connect to internet will
> include the QGIS proxy settings? (what is the best practice here?)
> - How to check if it is possible to access an internet page, so that if it
> is not possible to get the online version, we could fall back on the local
> version?
>
> Thanks for your time ,
> Cheers,
> Rémi-C
>
___
Qgis-developer mailing list
Qgis-developer@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/qgis-developer

Re: [Qgis-developer] PostGIS edition and foreign key

2015-03-03 Thread Rémi Cura
How do you merge exactly?

You could use PostGIS trick, like droping the foreign key constraint, and
trusting QGIS, but it would be a poor idea.

Another option would be to create triggers to clean the merging done by
qgis, so no foreign key constraint is violated, but it would depend on what
is this merge exactly.

Are you talking about the
vector/geoprocessing tools/Dissolve ?

Cheers,
Rémi-C

2015-03-03 11:14 GMT+01:00 Thibaut Gheysen :

> Hi,
>
> I would like to have your opinion in order to simplify as much as possible
> our current workflow.
>
> We have a table parcel and a table operation. The table operation include
> a foreign key to the table parcel. We have 2 parcels (A and B) but only
> parcel A has operations link on it. I would like to merge the 2 parcels by
> keeping the attributes of the parcel A. The merge is doing properly but
> impossible to save the edit (Provider errors: PostGIS error while deleting
> feature: ERROR: update or delete table "parcel" violates foreign key
> constraint"fk_parcel" on table "operation"). I guess this is due to the
> fact the Qgis first delete the 2 parcels (A and B) before creating a new
> one (merged one).
> This behaviour oblige us to export the table parcel into a shapefile and
> make the modifications on it. Once done, we import the shapefile into
> PostGIS and update the parcel geometry base on it.
>
> Is there any chance to find an easier workflow, without developing a
> plug-in ?
>
> Thank for your help.
>
> Best regards,
> Thibaut.
>
>
>
>
>
>
> ___
> Qgis-developer mailing list
> Qgis-developer@lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/qgis-developer
>
___
Qgis-developer mailing list
Qgis-developer@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/qgis-developer

[Qgis-developer] accessing a web page from within a plug-in

2015-03-02 Thread Rémi Cura
Hey dear Qgis list,

my question is related to network and plugin.

>From within our plugin 
we would like to display a User Guide

.
This guide already exists on GitHub, and it would be good to directly
display the html fo the github page in the plugin.


Of course internet is not always accessible, so we have a local version of
html pages in the plugin directory.

SO there is 2 questions :
- Are we sure that using the `QWebView` to connect to internet will include
the QGIS proxy settings? (what is the best practice here?)
- How to check if it is possible to access an internet page, so that if it
is not possible to get the online version, we could fall back on the local
version?

Thanks for your time ,
Cheers,
Rémi-C
___
Qgis-developer mailing list
Qgis-developer@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/qgis-developer

[Qgis-developer] bug with 3D vector editing in qgis 2.6

2015-02-25 Thread Rémi Cura
Hey Dear list,
I opened a ticket a while ago (https://hub.qgis.org/issues/12010) about a
bug in editing 3D postGIS layer with QGIS.

Strangely enough editing is fine (Z is put to 0, which is OK),
but trying to create a geometry raise an error  "Column has Z dimension but
geometry does not"

The only workaround I found was to create a trigger on the vector table
that forces the input to 3D
(ST_Force3D(geom)).
It is however ugly and not good performance wise.

Somebody has a better idea?

Cheers,
Rémi-C
___
Qgis-developer mailing list
Qgis-developer@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/qgis-developer

Re: [Qgis-developer] Display PostGIS Raster

2015-02-16 Thread Rémi Cura
Hey,
I remember having to use a very up to date gdal version to visualize
postgis raster without bug and/or excessive slowness.

Cheers,
Rémi-C

2015-02-16 13:42 GMT+01:00 Yves Jacolin :

> On Monday, February 16, 2015 4:35:28 walter.nordmann wrote:
> > Hi,
> >
> > tried to install the wktraster-plugin but with no luck.
> >
> > error in german: *Metadatendatei fehlt*
> > which means:  meta datafile is missing.
> >
> > Any other solution to display rasters from PostGIS in Qgis?
> >
> > Regards
> Walter,
>
> wktraster doesn't seem supported anymore and haven't been upgraded for QGIS
> 2.0.
>
> You should be able to display raster via DB-manager and add them into
> QGIS. I
> remember testing a little bit this way a while.
>
> Y.
>
>
> ___
> Qgis-developer mailing list
> Qgis-developer@lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/qgis-developer
>
___
Qgis-developer mailing list
Qgis-developer@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/qgis-developer

Re: [Qgis-developer] refresh postgis layer

2015-02-12 Thread Rémi Cura
Hey Martin,
thanks for the answer (again !)

Apparently it still doesn't refresh anything.
When I do it manually I use the "Refresh" button, and this works.
(The zoom trick also works)

Could it be because the layer needing refresh are not only the active layer
but all the others?

Cheers,
Rémi-C

2015-02-12 17:42 GMT+01:00 Martin Dobias :

> Hi Remi
>
> On Thu, Feb 12, 2015 at 11:27 PM, Rémi Cura  wrote:
>
>> Hello dear list,
>>
>> in  the process of developing a plugin (python 2.7, QGIS 2.6),
>>
>> from pyqgis ,
>> we would like to refresh a Postgis layer.
>> When using the vectorLayer.refresh(), it does nothing.
>>
>
> Try vectorLayer.triggerRepaint()
>
> Calling refresh() of the canvas will not work because even though the
> canvas will get refreshed, it will use previously cached map images. With
> triggerRepaint() the cached map image of your layer will get cleared and
> also refresh() will be called for any canvas that displays such layer.
>
> Regards
> Martin
>
>
___
Qgis-developer mailing list
Qgis-developer@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/qgis-developer

Re: [Qgis-developer] commit change in geometry produce fatal error

2015-02-12 Thread Rémi Cura
Thanks a lot for those fast and accurate suggestions.

We try to do as you propose and post the result here!

Many thanks,
Rémi-C

2015-02-12 18:07 GMT+01:00 Martin Dobias :

> Hi again Remi
>
> On Thu, Feb 12, 2015 at 11:46 PM, Rémi Cura  wrote:
>
>> Hello again dear list,
>>
>> Our goal is to save (commitchanges) any modification of a vector layer
>> when it happens.
>>
>>
>> We encountered another problem when trying to exploit the
>> layer.geometryChanged event.
>>
>> Upon activation of this event, we tried to use the layer.commitChanges()
>> to save changes in geometry of the layer (postgis layer, maybe not
>> related),
>>
>> But it hard-crashes QGIS.
>> A quick gdb look seems to indicate a rollback issue??
>>
>
> It is not a good idea to try to commit changes in a slot connected to a
> signal about layer modification - crashes due to corrupted undo stack can
> be expected (the undo stack is not in final state yet at the time of the
> signal being emitted). Also often the changes are done in batches (e.g.
> field calculator) and if you committed changes after each single change,
> this may lead to poor performance due to separate transactions.
>
> I think for your use case you could watch changes to the undo stack and
> commit whenever you detect a new undo command is added (e.g.
> canUndoChanged() or indexChanged() signal) you could commit the changes.
>
> Regards
> Martin
>
>
___
Qgis-developer mailing list
Qgis-developer@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/qgis-developer

[Qgis-developer] commit change in geometry produce fatal error

2015-02-12 Thread Rémi Cura
Hello again dear list,

Our goal is to save (commitchanges) any modification of a vector layer when
it happens.


We encountered another problem when trying to exploit the
layer.geometryChanged event.

Upon activation of this event, we tried to use the layer.commitChanges() to
save changes in geometry of the layer (postgis layer, maybe not related),

But it hard-crashes QGIS.
A quick gdb look seems to indicate a rollback issue??

The workaround we found was to use thread with short timers, but is is ill
suited for this.

Python 2.7, QGIS 2.6, Linux 64.

Somebody know how to fix this issue ?

Many thanks,
Rémi-C
___
Qgis-developer mailing list
Qgis-developer@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/qgis-developer

[Qgis-developer] refresh postgis layer

2015-02-12 Thread Rémi Cura
Hello dear list,

in  the process of developing a plugin (python 2.7, QGIS 2.6),

from pyqgis ,
we would like to refresh a Postgis layer.
When using the vectorLayer.refresh(), it does nothing.

We used a trick that works but seems like a bad idea :
(we slightly change the zoom to force rendering)
DEFAULT_SEGMENT_EPSILON = 1E-8
mapCanvas().zoomByFactor(1.0 + DEFAULT_SEGMENT_EPSILON, mapRect.center())

Somebody knows how to do it properly?
Thanks,
Rémi-C
___
Qgis-developer mailing list
Qgis-developer@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/qgis-developer

Re: [Qgis-developer] guestimating plug-in dev time?

2015-01-20 Thread Rémi Cura
Good to know.
I faced this postgis issue since 1.8
It would be a tremendous improve to have it solved in 2.6 (checking)
Cheers,
Rémi-C

2015-01-20 9:46 GMT+01:00 Andreas Neumann :

>  Hi Rémi,
>
> Good to hear. Note that 2.3 was the dev version and not the stable
> version. 2.4  was stable, then 2.6, 2.8, etc.
>
> Andreas
>
>
> On 20.01.2015 09:36, Rémi Cura wrote:
>
>   Many thanks for all the answers !
>  The new version (2.6) is way more stable than 2.3 regarding postgis table.
>  I'll do some torture test and submit tickets if I find any problem.
>  Cheers,
> Rémi-C
>
> 2015-01-19 13:31 GMT+01:00 George Silva :
>
>>  I also have a lot of experience with a large number of users (around
>> 15) editing a central database with PostGIS. No problems there.
>>
>>  Remi, the development time for this would be around a day. If you wish
>> to outsource that job, I have some experience with QGIS Plugins and I could
>> develop that for you.
>>
>>  George
>>
>> On Mon, Jan 19, 2015 at 10:29 AM, Bernhard Ströbl <
>> bernhard.stro...@jena.de> wrote:
>>
>>> Hi Andreas,
>>>
>>> I do not think that multi-core rendering is the issue here as Remi
>>> mentions to have experienced crashes since QGIS 1.8.
>>>
>>> Remi,
>>> I am using QGIS with Postgres/PostGIS with some dozens of users on a
>>> central database _without_ any issues in QGIS (except the multi-core issue
>>> Andreas mentioned). So do share your problems together with relevent parts
>>> of your data base so they can beanalyzed.
>>>
>>> Bernhard
>>>
>>> Am 19.01.2015 13:19, schrieb Andreas Neumann:
>>>
>>>>  Hi Remi,
>>>>
>>>> Regarding crashes with Postgis: do you have multithreading with a lot of
>>>> CPU cores active? I am experiencing crashes if more than 2 cores are
>>>> active. Try limiting to 2 CPU cores and see if this helps.
>>>>
>>>> Still trying to investigate this issue with the devs.
>>>>
>>>> Besides the above issue, editing with Postgis works stable for me -
>>>> certainly not as many crashes as you say you have.
>>>>
>>>> Please do not ignore the crashes but try to report them so that the devs
>>>> can do something about it.
>>>>
>>>> Andreas
>>>>
>>>> On 19.01.2015 11:57, Rémi Cura wrote:
>>>>
>>>>>  I think a more global solution is possible.
>>>>> After all when you load a postgis layer in qgis, if somebody else
>>>>> changes it, the view is not refreshed, which is annoying (and
>>>>> sometimes dangerous because you may edit old data).
>>>>>
>>>>> It would be easy to ad this (which would also work for my case) using
>>>>> the LISTEN / NOTIFY feature of postgres.
>>>>>
>>>>> Basically when selecting a table as a new qgis layer, you
>>>>> automatically add a triger to it.
>>>>> The trigger will be fired at any change (create/delete/update).
>>>>> The trigger would simply send a message to qgis via NOTIFY.
>>>>> example : "NOTIFY qgis_change_ ;", where  is a unique id.
>>>>> Of course qgis would be listening, which is very simple in python
>>>>> (import psycopg2;
>>>>> conn = psycopg.connect(my_database_string)
>>>>> conn.autocommit(1)
>>>>> curs = conn.cursor()
>>>>> curs.execute("LISTEN qgis_change_;"))
>>>>>
>>>>> Of course one would need a mechanism to remove this trigger when not
>>>>>  necessary (for instance, name the channel "qgis_change_/time_stamp/",
>>>>> delete channel too old automatically, and change channel periodically
>>>>> (20 in for instance)).
>>>>>
>>>>> I don't know if from a security point of view it would be possibe
>>>>> tough (would require the permission to create a trigger).
>>>>> I don't know if typical qgis user have the right to create trigger on
>>>>> database they use.
>>>>>
>>>>> I use a lot of different version of QGIS and I can guarantee at least
>>>>> a dozen crash a day with version 1.8 to 2.3,
>>>>> plus pending transaction with postgis whenever the crash occurs.
>>>>> I'm installing 2.6 to see if postgis layers are less fragile right now
>>>>> ^^
>>

Re: [Qgis-developer] guestimating plug-in dev time?

2015-01-20 Thread Rémi Cura
Many thanks for all the answers !
The new version (2.6) is way more stable than 2.3 regarding postgis table.
I'll do some torture test and submit tickets if I find any problem.
Cheers,
Rémi-C

2015-01-19 13:31 GMT+01:00 George Silva :

> I also have a lot of experience with a large number of users (around 15)
> editing a central database with PostGIS. No problems there.
>
> Remi, the development time for this would be around a day. If you wish to
> outsource that job, I have some experience with QGIS Plugins and I could
> develop that for you.
>
> George
>
> On Mon, Jan 19, 2015 at 10:29 AM, Bernhard Ströbl <
> bernhard.stro...@jena.de> wrote:
>
>> Hi Andreas,
>>
>> I do not think that multi-core rendering is the issue here as Remi
>> mentions to have experienced crashes since QGIS 1.8.
>>
>> Remi,
>> I am using QGIS with Postgres/PostGIS with some dozens of users on a
>> central database _without_ any issues in QGIS (except the multi-core issue
>> Andreas mentioned). So do share your problems together with relevent parts
>> of your data base so they can beanalyzed.
>>
>> Bernhard
>>
>> Am 19.01.2015 13:19, schrieb Andreas Neumann:
>>
>>> Hi Remi,
>>>
>>> Regarding crashes with Postgis: do you have multithreading with a lot of
>>> CPU cores active? I am experiencing crashes if more than 2 cores are
>>> active. Try limiting to 2 CPU cores and see if this helps.
>>>
>>> Still trying to investigate this issue with the devs.
>>>
>>> Besides the above issue, editing with Postgis works stable for me -
>>> certainly not as many crashes as you say you have.
>>>
>>> Please do not ignore the crashes but try to report them so that the devs
>>> can do something about it.
>>>
>>> Andreas
>>>
>>> On 19.01.2015 11:57, Rémi Cura wrote:
>>>
>>>> I think a more global solution is possible.
>>>> After all when you load a postgis layer in qgis, if somebody else
>>>> changes it, the view is not refreshed, which is annoying (and
>>>> sometimes dangerous because you may edit old data).
>>>>
>>>> It would be easy to ad this (which would also work for my case) using
>>>> the LISTEN / NOTIFY feature of postgres.
>>>>
>>>> Basically when selecting a table as a new qgis layer, you
>>>> automatically add a triger to it.
>>>> The trigger will be fired at any change (create/delete/update).
>>>> The trigger would simply send a message to qgis via NOTIFY.
>>>> example : "NOTIFY qgis_change_ ;", where  is a unique id.
>>>> Of course qgis would be listening, which is very simple in python
>>>> (import psycopg2;
>>>> conn = psycopg.connect(my_database_string)
>>>> conn.autocommit(1)
>>>> curs = conn.cursor()
>>>> curs.execute("LISTEN qgis_change_;"))
>>>>
>>>> Of course one would need a mechanism to remove this trigger when not
>>>> necessary (for instance, name the channel "qgis_change_/time_stamp/",
>>>> delete channel too old automatically, and change channel periodically
>>>> (20 in for instance)).
>>>>
>>>> I don't know if from a security point of view it would be possibe
>>>> tough (would require the permission to create a trigger).
>>>> I don't know if typical qgis user have the right to create trigger on
>>>> database they use.
>>>>
>>>> I use a lot of different version of QGIS and I can guarantee at least
>>>> a dozen crash a day with version 1.8 to 2.3,
>>>> plus pending transaction with postgis whenever the crash occurs.
>>>> I'm installing 2.6 to see if postgis layers are less fragile right now
>>>> ^^
>>>>
>>>> Cheers,
>>>> Rémi-C
>>>>
>>>> 2015-01-19 11:29 GMT+01:00 Martin Dobias >>> <mailto:wonder...@gmail.com>>:
>>>>
>>>> I see - indeed QGIS would need to do quite some database
>>>> inspection to understand that layer A and layer B are related.
>>>> This should be however also easy to address in a custom plugin.
>>>>
>>>> It is surprising to me that you say PostGIS layers are fragile in
>>>> QGIS - they are very commonly used by lots of people and we
>>>> haven't heard about crashes in the issue tracker. If you do
>>>> experience crashes please co

Re: [Qgis-developer] guestimating plug-in dev time?

2015-01-19 Thread Rémi Cura
I think a more global solution is possible.
After all when you load a postgis layer in qgis, if somebody else changes
it, the view is not refreshed, which is annoying (and sometimes dangerous
because you may edit old data).

It would be easy to ad this (which would also work for my case) using the
LISTEN / NOTIFY feature of postgres.

Basically when selecting a table as a new qgis layer, you automatically add
a triger to it.
The trigger will be fired at any change (create/delete/update).
The trigger would simply send a message to qgis via NOTIFY.
example : "NOTIFY qgis_change_ ;", where  is a unique id.
Of course qgis would be listening, which is very simple in python
(import psycopg2;
conn = psycopg.connect(my_database_string)
conn.autocommit(1)
curs = conn.cursor()
curs.execute("LISTEN qgis_change_;"))

Of course one would need a mechanism to remove this trigger when not
necessary (for instance, name the channel "qgis_change_*time_stamp*",
delete channel too old automatically, and change channel periodically (20
in for instance)).

I don't know if from a security point of view it would be possibe tough
(would require the permission to create a trigger).
I don't know if typical qgis user have the right to create trigger on
database they use.

I use a lot of different version of QGIS and I can guarantee at least a
dozen crash a day with version 1.8 to 2.3,
plus pending transaction with postgis whenever the crash occurs.
I'm installing 2.6 to see if postgis layers are less fragile right now ^^

Cheers,
Rémi-C

2015-01-19 11:29 GMT+01:00 Martin Dobias :

> I see - indeed QGIS would need to do quite some database inspection to
> understand that layer A and layer B are related. This should be however
> also easy to address in a custom plugin.
>
> It is surprising to me that you say PostGIS layers are fragile in QGIS -
> they are very commonly used by lots of people and we haven't heard about
> crashes in the issue tracker. If you do experience crashes please consider
> filing reports on hub.qgis.org with instructions on how to replicate them.
>
> Regards
> Martin
>
>
> On Mon, Jan 19, 2015 at 5:18 PM, Rémi Cura  wrote:
>
>> Thanks Martin,
>> one day to several days feel like a very reasonnable order of magnitude.
>>
>> QGis is not refreshing the view because when editing layer A the postgis
>> data base automatically also edit layer B.
>> I don't think qgis has a mechanism of tracking dbchanges (it would be
>> possible tough).
>> Morevover PostGIS layer are still "fragile" in qgis (crashes often).
>>
>> Thanks for the help,
>> Cheers
>> Rémi-C
>>
>> 2015-01-19 10:56 GMT+01:00 Martin Dobias :
>>
>>> Hi Remi
>>>
>>> Such plugin should be quite easy to write - I would assume up to one day
>>> of work for an experienced pyqgis developer. For a newcomer it may take few
>>> more days to get familiar with the API, tools, environment and so on.
>>>
>>> For the refresh of rendering after geometry editing - that should work
>>> out of the box and I would consider it a bug if it does not.
>>>
>>> Regards
>>> Martin
>>>
>>>
>>> On Mon, Jan 19, 2015 at 3:16 PM, Rémi Cura  wrote:
>>>
>>>> Hello dear list.
>>>> I'm usually active on the postgis or postgres list,
>>>> but today I would like to ask a question regarding dev time.
>>>>
>>>> In your opinion,
>>>> How much time would be needed to write a plugin for multiple versions
>>>> of qgis (2.2 to current 2.6) doing 3 simple things :
>>>>  - auto commit the edition of geometry when in edition mode (no need to
>>>> click on save  changes each time)
>>>>  - force refresh of rendering after edition of a geometry
>>>>  - every camera changes (zoom or position), send a sql query containing
>>>> user name and geometry of view (a rectangle in wkt for instance).
>>>>
>>>> I can estimate this at my poor qgis-dev level, but I would like to have
>>>> the timing for an expert qgis dev.
>>>>
>>>> Many thanks,
>>>>
>>>> Remi-C
>>>>
>>>> ___
>>>> Qgis-developer mailing list
>>>> Qgis-developer@lists.osgeo.org
>>>> http://lists.osgeo.org/mailman/listinfo/qgis-developer
>>>>
>>>
>>>
>>
>
___
Qgis-developer mailing list
Qgis-developer@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/qgis-developer

[Qgis-developer] guestimating plug-in dev time?

2015-01-19 Thread Rémi Cura
Hello dear list.
I'm usually active on the postgis or postgres list,
but today I would like to ask a question regarding dev time.

In your opinion,
How much time would be needed to write a plugin for multiple versions of
qgis (2.2 to current 2.6) doing 3 simple things :
 - auto commit the edition of geometry when in edition mode (no need to
click on save  changes each time)
 - force refresh of rendering after edition of a geometry
 - every camera changes (zoom or position), send a sql query containing
user name and geometry of view (a rectangle in wkt for instance).

I can estimate this at my poor qgis-dev level, but I would like to have the
timing for an expert qgis dev.

Many thanks,

Remi-C
___
Qgis-developer mailing list
Qgis-developer@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/qgis-developer