QGIS ignore the cpg files when loading shapefiles ?

classic Classic list List threaded Threaded
13 messages Options
Reply | Threaded
Open this post in threaded view
|

QGIS ignore the cpg files when loading shapefiles ?

Andrea Peri
Hi,
I'm using qgis 2.18
I have a charset probem .
So I try to create a cpg file and write on it UTF-8.
But nothing chance.

Instead if a go to properties, and change the CS from "system" to "UTF-8".
I see the labels have rightly reproduced.

I like to know if is confirmed that qgis is ignoring the cpg file.


Thx,
A.


--
-----------------
Andrea Peri
. . . . . . . . .
qwerty àèìòù
-----------------

_______________________________________________
Qgis-user mailing list
[hidden email]
List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user
Reply | Threaded
Open this post in threaded view
|

Re: QGIS ignore the cpg files when loading shapefiles ?

Tobias Wendorff
Am Fr, 29.12.2017, 12:19 schrieb Andrea Peri:
>
> I like to know if is confirmed that qgis is ignoring the cpg file.

1. Goto Settings > Options > Data Sources,
2. Check / uncheck "Ignore shapefile encoding declaration".

One of the top annoying problems I often have to deal with ;)

_______________________________________________
Qgis-user mailing list
[hidden email]
List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user
Reply | Threaded
Open this post in threaded view
|

Re: QGIS ignore the cpg files when loading shapefiles ?

Andrea Peri
Hi Tobias.

It work on qgis desktop. THX.

Do You know if that setting is available also in gis-server ?

A.


Il 29 Dic 2017 12:25, "Tobias Wendorff" <[hidden email]> ha scritto:
Am Fr, 29.12.2017, 12:19 schrieb Andrea Peri:
>
> I like to know if is confirmed that qgis is ignoring the cpg file.

1. Goto Settings > Options > Data Sources,
2. Check / uncheck "Ignore shapefile encoding declaration".

One of the top annoying problems I often have to deal with ;)


_______________________________________________
Qgis-user mailing list
[hidden email]
List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user
Reply | Threaded
Open this post in threaded view
|

Re: QGIS ignore the cpg files when loading shapefiles ?

pcav
Il 29/12/2017 12:32, Andrea Peri ha scritto:
> Hi Tobias.
>
> It work on qgis desktop. THX.
>
> Do You know if that setting is available also in gis-server ?

the server takes data loading options from the project, so you should
not neet a specific server option.
all the best.

--
Paolo Cavallini - www.faunalia.eu
QGIS & PostGIS courses: http://www.faunalia.eu/training.html
https://www.google.com/trends/explore?date=all&geo=IT&q=qgis,arcgis
_______________________________________________
Qgis-user mailing list
[hidden email]
List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user
Reply | Threaded
Open this post in threaded view
|

Re: QGIS ignore the cpg files when loading shapefiles ?

Andrea Peri
So in a QGIS desktop theuser can say to QGIS to use the CPG files,
and in QGIS-Server the user cannot say to qgis to use the CPG files, that is so sistematically ignored.

Wow.
:)


Il 29 Dic 2017 12:33, "Paolo Cavallini" <[hidden email]> ha scritto:
Il 29/12/2017 12:32, Andrea Peri ha scritto:
> Hi Tobias.
>
> It work on qgis desktop. THX.
>
> Do You know if that setting is available also in gis-server ?

the server takes data loading options from the project, so you should
not neet a specific server option.
all the best.

--
Paolo Cavallini - www.faunalia.eu
QGIS & PostGIS courses: http://www.faunalia.eu/training.html
https://www.google.com/trends/explore?date=all&geo=IT&q=qgis,arcgis
_______________________________________________
Qgis-user mailing list
[hidden email]
List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user

_______________________________________________
Qgis-user mailing list
[hidden email]
List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user
Reply | Threaded
Open this post in threaded view
|

Re: QGIS ignore the cpg files when loading shapefiles ?

pcav
Il 29/12/2017 12:49, Andrea Peri ha scritto:
> So in a QGIS desktop theuser can say to QGIS to use the CPG files,
> and in QGIS-Server the user cannot say to qgis to use the CPG files,
> that is so sistematically ignored.

quite the contrary in fact. you define it once, read it anywhere.
all the best.

--
Paolo Cavallini - www.faunalia.eu
QGIS & PostGIS courses: http://www.faunalia.eu/training.html
https://www.google.com/trends/explore?date=all&geo=IT&q=qgis,arcgis
_______________________________________________
Qgis-user mailing list
[hidden email]
List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user
Reply | Threaded
Open this post in threaded view
|

Re: QGIS ignore the cpg files when loading shapefiles ?

Richard Duivenvoorde
In reply to this post by Andrea Peri

I think you misunderstand Paolo.

Paolo means: that you define it IN the project file, which is also used
in the server. So IF you define to ignore it when you define your
project (in desktop) then the server will also and vice versa.

So the project is leading

Regards,

Richard Duivenvoorde

On 29-12-17 12:49, Andrea Peri wrote:

> So in a QGIS desktop theuser can say to QGIS to use the CPG files,
> and in QGIS-Server the user cannot say to qgis to use the CPG files,
> that is so sistematically ignored.
>
> Wow.
> :)
>
>
> Il 29 Dic 2017 12:33, "Paolo Cavallini" <[hidden email]
> <mailto:[hidden email]>> ha scritto:
>
>     Il 29/12/2017 12:32, Andrea Peri ha scritto:
>     > Hi Tobias.
>     >
>     > It work on qgis desktop. THX.
>     >
>     > Do You know if that setting is available also in gis-server ?
>
>     the server takes data loading options from the project, so you should
>     not neet a specific server option.
>     all the best.
>
>     --
>     Paolo Cavallini - www.faunalia.eu <http://www.faunalia.eu>
>     QGIS & PostGIS courses: http://www.faunalia.eu/training.html
>     <http://www.faunalia.eu/training.html>
>     https://www.google.com/trends/explore?date=all&geo=IT&q=qgis,arcgis
>     <https://www.google.com/trends/explore?date=all&geo=IT&q=qgis,arcgis>
>     _______________________________________________
>     Qgis-user mailing list
>     [hidden email] <mailto:[hidden email]>
>     List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
>     <https://lists.osgeo.org/mailman/listinfo/qgis-user>
>     Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user
>     <https://lists.osgeo.org/mailman/listinfo/qgis-user>
>
>
>
> _______________________________________________
> Qgis-user mailing list
> [hidden email]
> List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
> Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user
>

_______________________________________________
Qgis-user mailing list
[hidden email]
List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user
Reply | Threaded
Open this post in threaded view
|

Re: QGIS ignore the cpg files when loading shapefiles ?

Tobias Wendorff
Am Fr, 29.12.2017, 13:02 schrieb Richard Duivenvoorde:
>
> So the project is leading

Then the setting is in the wrong place. In QGIS3, it's an application
wide setting, not a project setting.

_______________________________________________
Qgis-user mailing list
[hidden email]
List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user
Reply | Threaded
Open this post in threaded view
|

Re: QGIS ignore the cpg files when loading shapefiles ?

pcav
In reply to this post by Richard Duivenvoorde
Il 29/12/2017 13:02, Richard Duivenvoorde ha scritto:
>
> I think you misunderstand Paolo.

Thanks for clarifying Richard. Sorry for being unclear, time is always
too short, and I feel that an incomplete response is better that the
silence.
All the best.

--
Paolo Cavallini - www.faunalia.eu
QGIS & PostGIS courses: http://www.faunalia.eu/training.html
https://www.google.com/trends/explore?date=all&geo=IT&q=qgis,arcgis
_______________________________________________
Qgis-user mailing list
[hidden email]
List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user
Reply | Threaded
Open this post in threaded view
|

Re: QGIS ignore the cpg files when loading shapefiles ?

Richard Duivenvoorde
In reply to this post by Tobias Wendorff
On 29-12-17 13:12, Tobias Wendorff wrote:
> Am Fr, 29.12.2017, 13:02 schrieb Richard Duivenvoorde:
>>
>> So the project is leading
>
> Then the setting is in the wrong place. In QGIS3, it's an application
> wide setting, not a project setting.

Hi Tobias,

Sorry. You are right. I was just echoing my interpretation of Paolo's email.

It seems a indeed an application setting:
 /qgis/ignoreShapeEncoding
used here:

https://github.com/qgis/QGIS/blob/master/src/providers/ogr/qgsogrprovider.cpp#L433

In desktop defaulting to true:
https://github.com/qgis/QGIS/blob/master/src/app/qgsoptions.cpp#L644

I'm not familiar with how the settings/environment are created for the
server.

Depending the view on being it a project setting, or a application
setting, it should be, or NOT be in the project file.
BUT if not be in the project file, there is maybe a way (via custom
settings?) to put this kind of stuff in the environment?

In 3.0 and 2.18 I changed the value to false, but could not find
anything in the project file.

I think we should try to define this clearly:
- should we define it a project or a application
(?? is one server one application??) setting
- where does the 'settings' come from for a freshly started qgisserver.
(as normally you do not use the same server machine on which you run
desktop)

Regards,

Richard Duivenvoorde
_______________________________________________
Qgis-user mailing list
[hidden email]
List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user
Reply | Threaded
Open this post in threaded view
|

Re: QGIS ignore the cpg files when loading shapefiles ?

Andrea Peri
Hi,
I confirm .
The setting is at application level , not at project level.

I have my desktop set to "ignore setting", but when move to qgis-server it don't use the cpg file.

So now I'm now changing manually all the layers one by one in my project qgis from System to the effective charset of every single shapefile to use them on qgis-server.

A.


2017-12-29 13:58 GMT+01:00 Richard Duivenvoorde <[hidden email]>:
On 29-12-17 13:12, Tobias Wendorff wrote:
> Am Fr, 29.12.2017, 13:02 schrieb Richard Duivenvoorde:
>>
>> So the project is leading
>
> Then the setting is in the wrong place. In QGIS3, it's an application
> wide setting, not a project setting.

Hi Tobias,

Sorry. You are right. I was just echoing my interpretation of Paolo's email.

It seems a indeed an application setting:
 /qgis/ignoreShapeEncoding
used here:

https://github.com/qgis/QGIS/blob/master/src/providers/ogr/qgsogrprovider.cpp#L433

In desktop defaulting to true:
https://github.com/qgis/QGIS/blob/master/src/app/qgsoptions.cpp#L644

I'm not familiar with how the settings/environment are created for the
server.

Depending the view on being it a project setting, or a application
setting, it should be, or NOT be in the project file.
BUT if not be in the project file, there is maybe a way (via custom
settings?) to put this kind of stuff in the environment?

In 3.0 and 2.18 I changed the value to false, but could not find
anything in the project file.

I think we should try to define this clearly:
- should we define it a project or a application
(?? is one server one application??) setting
- where does the 'settings' come from for a freshly started qgisserver.
(as normally you do not use the same server machine on which you run
desktop)

Regards,

Richard Duivenvoorde
_______________________________________________
Qgis-user mailing list
[hidden email]
List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user



--
-----------------
Andrea Peri
. . . . . . . . .
qwerty àèìòù
-----------------

_______________________________________________
Qgis-user mailing list
[hidden email]
List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user
Reply | Threaded
Open this post in threaded view
|

Re: QGIS ignore the cpg files when loading shapefiles ?

Tobias Wendorff
In reply to this post by Richard Duivenvoorde
Am Fr, 29.12.2017, 13:58 schrieb Richard Duivenvoorde:
>
> I think we should try to define this clearly:
> - should we define it a project or a application
> (?? is one server one application??) setting
> - where does the 'settings' come from for a freshly started qgisserver.
> (as normally you do not use the same server machine on which you run
> desktop)

I can't answer on qgisserver, but this setting for QGIS2 was one of
the most problematic ones, I had to deal with. I don't know if the
default switches in the past, but often the CPG was ignored on
shapefiles. When exporting the data into a new shapefile, messed the
content up pretty often.

I think, most English aren't aware of this problem, since their chars
are covered by almost all charsets. I'm German and we're using umlauts
and ligatures (like äöüß). The incorrect parsing of the charset always
makes trouble here :(

_______________________________________________
Qgis-user mailing list
[hidden email]
List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user
Reply | Threaded
Open this post in threaded view
|

Re: QGIS ignore the cpg files when loading shapefiles ?

kimaidou
In reply to this post by Andrea Peri
Hi,

Some comments about this issue :

* we should add an project option for this too, wich overrides the QGIS setting
* there is a way to create an option file read by the server, where you can add the options you like. See the doc in [1]

Basically:

* create a file somewhere in the server, e.g.

/svr/qgis/config/QGIS/QGIS2.ini

* Add some variables in this file, for example
[svg]
searchPathsForSVG=/srv/data/mysvg|/home/data/other_svg

* Set the env variable to tell QGIS Server where to read the config file

FcgidInitialEnv QGIS_OPTIONS_PATH "/srv/qgis/config/"

Regards
Michaël




2017-12-29 14:31 GMT+01:00 Andrea Peri <[hidden email]>:
Hi,
I confirm .
The setting is at application level , not at project level.

I have my desktop set to "ignore setting", but when move to qgis-server it don't use the cpg file.

So now I'm now changing manually all the layers one by one in my project qgis from System to the effective charset of every single shapefile to use them on qgis-server.

A.


2017-12-29 13:58 GMT+01:00 Richard Duivenvoorde <[hidden email]>:
On 29-12-17 13:12, Tobias Wendorff wrote:
> Am Fr, 29.12.2017, 13:02 schrieb Richard Duivenvoorde:
>>
>> So the project is leading
>
> Then the setting is in the wrong place. In QGIS3, it's an application
> wide setting, not a project setting.

Hi Tobias,

Sorry. You are right. I was just echoing my interpretation of Paolo's email.

It seems a indeed an application setting:
 /qgis/ignoreShapeEncoding
used here:

https://github.com/qgis/QGIS/blob/master/src/providers/ogr/qgsogrprovider.cpp#L433

In desktop defaulting to true:
https://github.com/qgis/QGIS/blob/master/src/app/qgsoptions.cpp#L644

I'm not familiar with how the settings/environment are created for the
server.

Depending the view on being it a project setting, or a application
setting, it should be, or NOT be in the project file.
BUT if not be in the project file, there is maybe a way (via custom
settings?) to put this kind of stuff in the environment?

In 3.0 and 2.18 I changed the value to false, but could not find
anything in the project file.

I think we should try to define this clearly:
- should we define it a project or a application
(?? is one server one application??) setting
- where does the 'settings' come from for a freshly started qgisserver.
(as normally you do not use the same server machine on which you run
desktop)

Regards,

Richard Duivenvoorde
_______________________________________________
Qgis-user mailing list
[hidden email]
List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user



--
-----------------
Andrea Peri
. . . . . . . . .
qwerty àèìòù
-----------------

_______________________________________________
Qgis-user mailing list
[hidden email]
List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user


_______________________________________________
Qgis-user mailing list
[hidden email]
List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user