Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

all coordinates truncated to integer values #34

Closed
tyrasd opened this issue Oct 19, 2014 · 17 comments
Closed

all coordinates truncated to integer values #34

tyrasd opened this issue Oct 19, 2014 · 17 comments
Labels
bug An identified bug

Comments

@tyrasd
Copy link

tyrasd commented Oct 19, 2014

For some reason, for me, all data requested via QuickOSM gets snapped to a grid where lat/lon values are integers:
bildschirmfoto vom 2014-10-19 10 39 12

Could it be that there is a number parsing issue because I'm on a PC with German locale (where floats are typeset with commas instead of decimal points)? But, setting the UI-language to English doesn't seem to help.

@mmd-osm
Copy link

mmd-osm commented Oct 19, 2014

I tried one of the demo queries (Shop) but couldn't reproduce this issue. QGIS is running in German as well.

qgis4

OSM map was added as background image for illustration purposes.

You could maybe try a custom layer description: concat (tostring( $x), ' ', tostring( $y )) to see the lat/lon infos as label next to each node:

qgis5

@tyrasd
Copy link
Author

tyrasd commented Oct 19, 2014

Printing the coordinates shows only integer values. Then, I've played around the language settings and found out that setting the Number format in Regional Formats in Ubuntu's language settings (see screenshot) to something English "resolves" the issue for me. Setting it back to German results in coordinate truncations.

screenshot from 2014-10-19 12 47 41

@mmd-osm
Copy link

mmd-osm commented Oct 19, 2014

Interesting. I'm running the following settings without issue. Maybe there's some other parameter somewhere in QGIS?!

qgis7

@Gustry
Copy link
Member

Gustry commented Oct 20, 2014

For each query, you'll find, in your temp folder, the raw dowloaded file *.osm, then a *.geojson and finally a *.shp. The shapefile will be in "processing" of the temp folder.
Could you try these 3 files and tell us which file are affected by this bug ?

@tyrasd
Copy link
Author

tyrasd commented Oct 20, 2014

The .osm and .geojson files in /tmp are fine. Only the resulting shapefile shows truncated coordinates.

@Gustry
Copy link
Member

Gustry commented Oct 20, 2014

Hum... The transformation from geojson to shapefile is done by QgsFileWriter since 1.1. On 1.0 it was ogr2ogr : 940bb90
From OSM to geojson : https://github.com/3liz/QgisQuickOSMPlugin/blob/master/CoreQuickOSM/Parser/OsmParser.py#L176
And then from geojson to shapefile : https://github.com/3liz/QgisQuickOSMPlugin/blob/master/Controller/Process.py#L95

@tyrasd
Copy link
Author

tyrasd commented Oct 20, 2014

ok, turns out my version of QGIS truncates the coordinates also when opening geojson files directly. So, I guess this is a QGIS bug? (This used to work with QGIS 2.0 which I had installed previously. btw: I've installed QGIS 2.4 via ubuntugis)

@mmd-osm
Copy link

mmd-osm commented Oct 20, 2014

fyi: I've installed QGIS 2.4 via http://qgis.org/en/site/forusers/alldownloads.html#ubuntu + QGIS Stable packages on plain ubuntu but I'm unable to reproduce the issue on that version.

QGIS Help->About has some detailed version infos of all involved components:

Description Version Description Version
QGIS-Version 2.4.0-Chugiak QGIS-Codeversion exported
Kompiliert gegen Qt 4.8.6 Laufendes Qt 4.8.6
Kompiliert mit GDAL/OGR 1.10.1 Läuft mit GDAL/OGR 1.10.1
Kompiliert mit GEOS 3.4.2-CAPI-1.8.2 Läuft mit GEOS 3.4.2-CAPI-1.8.2 r3921
PostgreSQL-Client-Version 9.3.4 SpatiaLite-Version 4.1.1
QWT-Version 5.2.3 PROJ.4-Version 480
QScintilla2-Version

You could check the shape files by running e.g. ogrinfo -al multipolygonsquickosm.shp in the temp directory. In my case, both lat/lon coordinates look ok (not truncated):

OGRFeature(multipolygonsquickosm):25
  full_id (String) = w76186459
  osm_id (String) = 76186459
  osm_type (String) = way
  building (String) = yes
  shop (String) = supermarket
  name (String) = Carrefour Market
  building_p (String) = (null)
  roof_mater (String) = (null)
  roof_heigh (String) = (null)
  height (String) = (null)
  roof_shape (String) = (null)
  website (String) = (null)
  brand (String) = (null)
  operator (String) = Carrefour
  wheelchair (String) = (null)
  addr_house (String) = (null)
  addr_city (String) = (null)
  addr_postc (String) = (null)
  addr_count (String) = (null)
  addr_stree (String) = (null)
  tourism (String) = (null)
  wheelcha_1 (String) = (null)
  wheelcha_2 (String) = (null)
  phone (String) = (null)
  amenity (String) = (null)
  wall (String) = (null)
  layer (String) = (null)
  addr_hou_1 (String) = (null)
  POLYGON ((3.8871116 43.6261383,3.8874954 43.6261388,3.8874961 43.6261278,3.8875824 43.6261278,3.8878846 43.6259574,3.8878937 43.6259659,3.8879561 43.6259308,3.887834 43.6258162,3.8878303 43.6258134,3.8878633 43.6257946,3.8878679 43.6257986,3.8879544 43.6258794,3.8880035 43.6258519,3.8879178 43.6257723,3.8876827 43.6255528,3.8876444 43.6255728,3.8875169 43.6256431,3.887413 43.6255445,3.8873827 43.6255615,3.8869147 43.6258239,3.8870249 43.625927,3.8871097 43.6260095,3.8871116 43.6261383))

@Gustry Gustry added the bug An identified bug label Oct 24, 2014
@Gustry
Copy link
Member

Gustry commented Nov 7, 2014

I have this bug too since I've reinstalled my OS.
However, I can't solv this bug by changing my settings into english.

The geojson, which contains decimals in a text-editor, can't by open correctly in QGIS.
I've opened an issue on qgis : http://hub.qgis.org/issues/11587

@mdouchin
Copy link
Collaborator

I leave the bug closed, but here is a quick workaround in linux distros. Run QGIS from command line like this

LC_NUMERIC="C" /usr/bin/qgis 1> /dev/null 2> /dev/null

Which forces QGIS to use the dot as decimal separator

@Gustry
Copy link
Member

Gustry commented Oct 20, 2015

Thanks @mdouchin !
If you have this problem, you can go in your QGIS settings :
options_qgis

@vinber
Copy link

vinber commented Oct 26, 2015

Thanks @Gustry for your help, but for me it works only in command line (LC_NUMERIC="C" /usr/bin/qgis 1> /dev/null 2> /dev/null)

I use QGIS 2.8 and ubuntu 14.04

@Gustry
Copy link
Member

Gustry commented Oct 27, 2015

It was working for one day. Now, it's not working anymore. @mdouchin is the screenshot right ?

@rldhont
Copy link
Collaborator

rldhont commented Oct 27, 2015

The screenshot is right. It has worked for me. Now I have to use the command line.

It's more a qgis issue, which does not force the LC_NUMERIC for GDAL.

@mdouchin
Copy link
Collaborator

It still works for me (ubuntu 15.05 fresh install), QGIS 2.12 with options "Overwrite" LC_NUMERIC "C"

@vinber
Copy link

vinber commented Oct 28, 2015

Le 28/10/2015 17:28, mdouchin a écrit :

ubuntu 15.05
it's a special version for you :)

I'll try with newer version of ubuntu and qgis

Thanks

Vincent Bergeot Num&Lib - Coop'Alpha

+33 6 95 04 73 98 / http://numetlib.fr

« La route est longue mais la voie est libre ! »

@Gustry
Copy link
Member

Gustry commented Oct 11, 2016

This issue has been fixed in GDAL 2.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug An identified bug
Projects
None yet
Development

No branches or pull requests

6 participants