QuickOSM icon indicating copy to clipboard operation
QuickOSM copied to clipboard

OSM name tag encoding

Open AAnderl opened this issue 4 years ago • 14 comments

Helllo,

I am experiencing the same isuue as described here: https://github.com/3liz/QuickOSM/issues/39

Bug seems to be closed since 2015 so probably I am doing something wrong (I'm new to Qgis).

Encoding

2021-12-01T14:35:47     INFO    Query: natural_water
2021-12-01T14:35:47     INFO    Encoded URL: https://lz4.overpass-api.de/api/interpreter?data=[out:xml] [timeout:25];%0A(%0A node[%22natural%22%3D%22water%22]( 42.31961,-8.00794,43.76536,-6.78239);%0A way[%22natural%22%3D%22water%22]( 42.31961,-8.00794,43.76536,-6.78239);%0A relation[%22natural%22%3D%22water%22]( 42.31961,-8.00794,43.76536,-6.78239);%0A);%0A(._;%3E;);%0Aout body;&info=QgisQuickOSMPlugin
2021-12-01T14:35:53     INFO    Request completed
2021-12-01T14:35:53     INFO    Checking OSM file content C:/Users//AppData/Local/Temp/request-IVhQgc.osm
2021-12-01T14:35:53     INFO    The OSM file is: C:/Users//AppData/Local/Temp/request-IVhQgc.osm
2021-12-01T14:35:54     INFO    Fixing geometries in layer: multipolygons
2021-12-01T14:35:54     INFO    The OSM parser took: 00h 00m 01s
2021-12-01T16:08:57     INFO    All OSM objects with the key 'natural'='water' in la extensión del lienzo o capa are going to be downloaded.

Environment

  • QuickOSM version: 3.18.3
  • QGIS version: 2.0.0
  • OS: Windows 10

Thanks in advance

AAnderl avatar Dec 01 '21 15:12 AAnderl

Hi there, Seems the bug has been fixed for point geometries but still persists for the other geometries.

Environment

QuickOSM version: 2.0.1
QGIS version: 3.16
OS: Windows 10

Technofinchen avatar Feb 21 '22 20:02 Technofinchen

Can you send an OSM file ? (in this ticket, drag and drop) I can't replicate, I guess.

I doubt there is a difference between geometry types. The process is the same.

Gustry avatar Feb 22 '22 08:02 Gustry

Hi there, Strangely, I can't reproduce it either, at least not all of it. Seems to be more complicated. I composed the query using the Quick Query feature. Yesterday it gave me bad character encodings in the "Name" column, today I reassembled it, it's ok. The funny thing is that I haven't even closed Qgis since yesterday. Today's result also has fewer columns. Also funny, when I run yesterday's saved query today, it gives me broken character encodings again. I used the same parameters yesterday to compose the query as I did today. There is a difference I can see as parts of today's query description are translated. Pretty weird.

grafik

Technofinchen avatar Feb 22 '22 15:02 Technofinchen

Just save data layer encoded windows-1251. After save in layer properties set encoding UTF-8

SergioAN007 avatar Mar 06 '22 14:03 SergioAN007

I've had similar problem while using quickosm algorithms inside model. Adding "set layer encoding" after "string concatenation" fixed the problem. image

royas avatar Mar 08 '22 16:03 royas

Hello,

Thanks for the answers. Apologies for the delay in responding.

Attached fresh file, downloaded today.

NaturalWater.zip

AAnderl avatar Mar 09 '22 19:03 AAnderl

I've had similar problem while using quickosm algorithms inside model. Adding "set layer encoding" after "string concatenation" fixed the problem. image

Royas, Thanks but unfortunately I'm not at that level. I don't know what all that beautiful stuff is.

Best regards

AAnderl avatar Mar 09 '22 19:03 AAnderl

Just save data layer encoded windows-1251. After save in layer properties set encoding UTF-8

I've tried and it's worse than before. Thank you anyway.

AAnderl avatar Mar 09 '22 19:03 AAnderl

Thats resolve problem with encoding in last version QuickOSM:

  1. Genarete request using QuickOSM 1 GenRequest

  2. Result request 2 ResultRequest

  3. Save as usually result (Export layer-UTf8-save) 3 Save as usually (Export layer-UTf8-save)

  4. Solve problem. Save layer in 1251 encode. (Export layer-windows-1251-save) 4 Solve problem (Export layer-windows-1251-save)

  5. Next in layer properties set UTF8 5 Solve problem (in layer properties set UTF8)

  6. Result 6 Result

SergioAN007 avatar Mar 11 '22 01:03 SergioAN007

Thats resolve problem with encoding in last version QuickOSM:

1. Genarete request using QuickOSM
   ![1 GenRequest](https://user-images.githubusercontent.com/25266691/157786080-6ae10676-1dd2-4a09-964f-15cff3fc2fb7.png)

2. Result request
   ![2 ResultRequest](https://user-images.githubusercontent.com/25266691/157786251-6f500c5b-0a0b-40e8-b1e9-3e7396ac4141.png)

3. Save as usually result (Export layer-UTf8-save)
   ![3 Save as usually (Export layer-UTf8-save)](https://user-images.githubusercontent.com/25266691/157786340-b86a2082-7bfe-41ff-b494-1f65cc5ee75d.png)

4. Solve problem. Save layer in 1251 encode. (Export layer-windows-1251-save)
   ![4 Solve problem (Export layer-windows-1251-save)](https://user-images.githubusercontent.com/25266691/157786514-b9329998-d0d9-49ae-a4ad-1ed5f6890bb8.png)

5. Next in layer properties set UTF8
   ![5 Solve problem (in layer properties set UTF8)](https://user-images.githubusercontent.com/25266691/157786747-2c5a0d72-ceab-40e0-8b6d-3e89293c2b59.png)

6. Result
   ![6 Result](https://user-images.githubusercontent.com/25266691/157786771-d03c2d02-368f-4c13-9665-d20d3251a601.png)

I really appreciate your efforts to help me, but it doesn't work

AAnderl avatar Mar 11 '22 16:03 AAnderl

Hello, I get the same problem on windows 11 but not on windows 10. I don't know if it's related but it looks like it depends on system environment. To get it work I choose Shapefile format to export data instead of geopackage (directly in QuickOSM UI in advanced) and then when I set to UTF-8 encoding in the layer properties of the layer it works. Be careful, use Shapefile will truncate fields name so you should take it into account on the rest of your workflow.

The bug is no more present in QGIS 3.24 Tisler!

Mika97400 avatar Apr 19 '22 12:04 Mika97400

Hello, I get the same problem on windows 11 but not on windows 10. I don't know if it's related but it looks like it depends on system environment. To get it work I choose Shapefile format to export data instead of geopackage (directly in QuickOSM UI in advanced) and then when I set to UTF-8 encoding in the layer properties of the layer it works. Be careful, use Shapefile will truncate fields name so you should take it into account on the rest of your workflow.

The bug is no more present in QGIS 3.24 Tisler!

Hello. Thanks for renponding. I did it always this way and problem persist. And I use 3.24.0 since it was launched. (Win 10)

AAnderl avatar Apr 22 '22 16:04 AAnderl

This bug is still present in the last QGIS versions (3.24.0, 3.24.1, 3.24.2) and the latest QuickOSM.

I've researched the issue a little and found out that:

  • issue happens on windows machines only;
  • all the resulting osm-files always have the correct encoding - UTF-8 (at least in all my cases). But by an unknown reason QGIS interprets and opens some of them with ANSI encoding (and some of them with correct UTF-8, of course).

I really do not know if the developer of QuickOSM could force QGIS to open all the generated osm-files with UTF-8 encoding only. If no then it seems that we have to make a ticket for QGIS developers

Regards

aflexus avatar Apr 22 '22 18:04 aflexus

This bug is still present in the last QGIS versions (3.24.0, 3.24.1, 3.24.2) and the latest QuickOSM.

I've researched the issue a little and found out that:

* issue happens on windows machines only;

* all the resulting osm-files always have the correct encoding - UTF-8 (at least in all my cases). But by an unknown reason QGIS interprets and opens some of them with ANSI encoding (and some of them with correct UTF-8, of course).

I really do not know if the developer of QuickOSM could force QGIS to open all the generated osm-files with UTF-8 encoding only. If no then it seems that we have to make a ticket for QGIS developers

Regards

Thanks for your comment and for pulling the request in Qgis.

AAnderl avatar Apr 25 '22 07:04 AAnderl