2

When I 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).

The same file is correctly shown by online GeoJSON validators.

<code>
{
    "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": ""
            }
        }
    ]
}
</code>
7
  • 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, 2018 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, 2018 at 18:40
  • Did you select "Decimal number (real)" as field type when creating the new virtual field? Feb 19, 2018 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, 2018 at 19:08
  • Error is not related , it's from previous operation. I deleted it.
    – Pin
    Feb 19, 2018 at 19:19

1 Answer 1

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.

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