2

When open the following GeoJSON file in QGIS 2.18 (drag and drop) , all point coordinates lost their decimals going, for example, from -9.350659, 44.32844 to 9, 44 .

Same file is correctly shown by online GeoJSON validators.

points.geojson { "type": "FeatureCollection", "features": [ { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -9.350659, 41.32844 ] }, "properties": { "name": "", "description": "" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -9.31515, 41.324892 ] }, "properties": { "name": "", "description": "" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -9.345253, 41.347425 ] }, "properties": { "name": "", "description": "" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -9.373701, 41.332987 ] }, "properties": { "name": "", "description": "" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -9.312632, 41.3205906 ] }, "properties": { "name": "", "description": "" } } ] }

  • Which QGIS are you using and how do you import the file? I don't have this issue with QGIS 2.18.2 – RutgerH Feb 19 '18 at 18:29
  • QGIS 2.18.16 I drag and drop the file (points.geojson) to QGIS , points appear all in the same position (-9,41) since all decimals are trunked. Then I open the layer attribute table and add a virtual field to see coordinates ($x and $y) , only integers appear. – Pin Feb 19 '18 at 18:40
  • Did you select "Decimal number (real)" as field type when creating the new virtual field? – tallistroan Feb 19 '18 at 18:48
  • Yes. Now I have just seen an error in logs , see question edit. I think problem is that geojson coordinates are geografic and qgis project use projected coordinates – Pin Feb 19 '18 at 19:08
  • Error is not related , it's from previous operation. I deleted it. – Pin Feb 19 '18 at 19:19
0

I came across the same issue this morning.

I am working with QGIS2.8.6 compiled against GDAL1.11.3 on Ubuntu16.04.

I fixed the issue by changing my locale parameters to C.UTF-8 (my locale parameters were previously fr_FR.utf8).

To do so I edited my /etc/default/locale file. It's all explained here: https://www.thomas-krenn.com/en/wiki/Configure_Locales_in_Ubuntu.

Pin: wouldn't it be nice if you could describe how you fixed your issue in an other answer? I wasn't sure how to update my gdal version for QGIS. Some hint would have been nice. Luckily I wanted to changed my langage parameters to american english for several reasons, but others might want to keep their langage parameters and wouldn't be able to use my fix.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.