[Qgis-user] QGIS + Postgis table problem

2012-01-06 Thread Pedro Jorge de Sousa Ferreira
Hi, 
I'm getting the following error when importing a Postgis table:
1 estado de cursor perdido.
SQL: CLOSE qgisf3
Resulta: 7 (ERROR:  current transaction is aborted, commands ignored until
end of transaction block
)
Does anyone know what it means and how to solve it?
thanks


-
Cumprimentos,
Pedro Ferreira
--
View this message in context: 
http://osgeo-org.1803224.n2.nabble.com/QGIS-Postgis-table-problem-tp7158069p7158069.html
Sent from the qgis-user mailing list archive at Nabble.com.
___
Qgis-user mailing list
Qgis-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/qgis-user


Re: [Qgis-user] New Labeling: conditional labels

2012-01-06 Thread Martin Dobias
Hi

On Thu, Dec 29, 2011 at 11:33 AM, Nathan Woodrow madman...@gmail.com wrote:
 It would be handy to add condition statements to QgsExpression so we can
 support this kind of thing, Martin would be the guy to talk to about adding
 this kind of thing.  He knows the most about QgsExpression.

SQL recognizes CASE statement with following alternate syntax:

1. if equivalent:
CASE
  WHEN x  10 THEN 'big' ELSE 'small'
END

2. switch equivalent:
CASE x
  WHEN 5 THEN 'five'
  WHEN 6 THEN 'six'
  ELSE 'something else'
END

The else is not required, if there is no matching when then NULL
is returned.

Some SQL engines add further functions for convenience:
- MySQL [1]: IF(), IFNULL(), NULLIF()
- PostgreSQL [2]: COALESCE(), NULLIF()

I would suggest to implement the CASE statement to stay compliant with
SQL syntax (although I find It a bit verbose).

Regards
Martin

[1] http://dev.mysql.com/doc/refman/5.0/en/control-flow-functions.html
[2] http://www.postgresql.org/docs/8.1/static/functions-conditional.html
___
Qgis-user mailing list
Qgis-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/qgis-user


[Qgis-user] Hard Coded Encodings

2012-01-06 Thread magerlin
This is a prayer for the plugin programmers!

First of all thank you for your contributions!

Qgis in it self is able to read and save shapefiles with many different
encodings, but some plugins seems to be hardcoded saving files in a specific
encoding.

One example is the ShapeFileSplitter. Even if I give an ISO8859-15 encoded
shapefile as input the resulting splitted files are in UTF-8. And it is a
bit troublesome when working with national characters.

I fully support another thread suggesting adding a .cpg file for storing the
encoding!


-
Regards Morten

(Qgis 1.7.3 standalone and Win 7)
--
View this message in context: 
http://osgeo-org.1803224.n2.nabble.com/Hard-Coded-Encodings-tp7158372p7158372.html
Sent from the qgis-user mailing list archive at Nabble.com.
___
Qgis-user mailing list
Qgis-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/qgis-user


Re: [Qgis-user] Hard Coded Encodings

2012-01-06 Thread Paolo Cavallini

Il 06/01/2012 14:17, magerlin ha scritto:

This is a prayer for the plugin programmers!


Please open a ticket.
Thanks.


--
Paolo Cavallini - Faunalia
www.faunalia.eu
Full contact details at www.faunalia.eu/pc
___
Qgis-user mailing list
Qgis-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/qgis-user


Re: [Qgis-user] New Labeling: conditional labels

2012-01-06 Thread Martin Dobias
On Fri, Jan 6, 2012 at 1:25 PM, Martin Dobias wonder...@gmail.com wrote:
 SQL recognizes CASE statement with following alternate syntax:

 1. if equivalent:
 CASE
  WHEN x  10 THEN 'big' ELSE 'small'
 END

Just pushed a commit implementing that.

The syntax is:
CASE WHEN cond1 THEN exp1 [WHEN cond2 THEN exp2]* [ELSE exp3] END

There may be one or more WHEN/THEN clauses. If no condition matches,
the expression from ELSE is evaluated - if none is specified then
NULL is returned.

Note: the other syntax with base expression (CASE x WHEN y THEN z
... END) is not supported yet.

Have fun!
Martin
___
Qgis-user mailing list
Qgis-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/qgis-user


Re: [Qgis-user] New Labeling: conditional labels

2012-01-06 Thread Nathan Woodrow
Love your work Martin!

I'll add syntax highlighting for it tonight/tomorrow sometime.

- Nathan

On Sat, Jan 7, 2012 at 10:31 AM, Martin Dobias wonder...@gmail.com wrote:

 On Fri, Jan 6, 2012 at 1:25 PM, Martin Dobias wonder...@gmail.com wrote:
  SQL recognizes CASE statement with following alternate syntax:
 
  1. if equivalent:
  CASE
   WHEN x  10 THEN 'big' ELSE 'small'
  END

 Just pushed a commit implementing that.

 The syntax is:
 CASE WHEN cond1 THEN exp1 [WHEN cond2 THEN exp2]* [ELSE exp3] END

 There may be one or more WHEN/THEN clauses. If no condition matches,
 the expression from ELSE is evaluated - if none is specified then
 NULL is returned.

 Note: the other syntax with base expression (CASE x WHEN y THEN z
 ... END) is not supported yet.

 Have fun!
 Martin

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