Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

If I have a GEOJson file, for example a file named test.js with inside the following:

{ "type": "FeatureCollection",
"features": [
{ "type": "Feature",
  "geometry": {"type": "Point", "coordinates": [102.0, 0.5]},
  "properties": {"prop0": "value0"}
  },
{ "type": "Feature",
  "geometry": {
    "type": "LineString",
    "coordinates": [
      [102.0, 0.0], [103.0, 1.0], [104.0, 0.0], [105.0, 1.0]
      ]
    },
  "properties": {
    "prop0": "value0",
    "prop1": 0.0
    }
  },
{ "type": "Feature",
   "geometry": {
     "type": "Polygon",
     "coordinates": [
       [ [100.0, 0.0], [101.0, 0.0], [101.0, 1.0],
         [100.0, 1.0], [100.0, 0.0] ]
       ]
   },
   "properties": {
     "prop0": "value0",
     "prop1": {"this": "that"}
     }
   }
 ]
}

how to open it with QGis? I open QGis, press "add vector layer", choose "File" but I am not able to open it. If I choose GEOJson format, my file is not showed in browser window. If I do not specify input type, I get the error: "your file is not valid or recognized data source". How have I to format this file? It seems there a little lack of documentation about this topic...

share|improve this question
    
To see the file in the file browser, it should have .geojson extension –  Devdatta Tengshe Jul 4 '14 at 17:42

2 Answers 2

Just Drag'n Drop the file in qgis, be aware that Qgis doesn't support mixed types in the same file (point, line, poly) and it will open only the first type found. In the example bellow with your geojson file, I imported each type at a time. enter image description here

share|improve this answer
    
Nice to know that I have to separate types, thanks! –  caneta Jul 31 '12 at 8:19

As of May 2015, mixed-type geojson files are supported.

share|improve this answer

We're looking for long answers that provide some explanation and context. Don't just give a one-line answer; explain why your answer is right, ideally with citations. Answers that don't include explanations may be removed.

1  
please expand on this what version QGIS 2.8.1? –  Mapperz May 21 at 2:17
    
I just spent 15 minutes searching and can find no documentation for when it became supported. Based on the previous answer at 2012, one would think since then. I checked the changelogs for QGIS, OGR, and the json-c library and could find no reference to enabling of mixed type support. However I did find github.com/akvo/akvo-flow/issues/1070 which shows a QGIS screenshot of adding a mixed type and the resulting dialog to choose which type to import. While it would be nice to have documentation, I would not expect this answerer who might have simply made the observation to research it. –  Chris W May 21 at 7:57
    
However it's unclear if that's what this answer is supposed to mean, or if it is implying that the file can be opened as a mixed geometry type in a single layer in QGIS (which is unlikely). To improve the answer, please expand on what you mean by "are supported" and which version you have at least tested this. –  Chris W May 21 at 8:02
    
This does not provide an answer to the question. To critique or request clarification from an author, leave a comment below their post - you can always comment on your own posts, and once you have sufficient reputation you will be able to comment on any post. –  SS_Rebelious May 21 at 13:42

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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