Closed VasiliosKalogirou closed 8 years ago
Hello,
Best regards. Maciej Kamiński
Hello Maciej,
All your points were spot on. I have used some random GeoJSON files I downloaded from OpenStreetMap if you would like to have some data for reference; all the datasets downloaded come in the same format. I believe that the real issue could be your in point no.5: A GeoJSON object can contain multiple geometries inside of the same type i.e. we can have a GeoJSON object containing multiple points. As a result, a document in MongoDB will represent multiple features/points.
Kind regards, Vasilios
I made few modifications so the new version is out. You can download from github and try before i upload into QGIS plugins site. Please tell me if it suits Your needs now.
Many thanks Maciej. I will look at it tomorrow. Cheers, Vas
Hi again, I am having some problems installing the plugin. Can you please recommend a way to install it by downloading from GitHub?
Thanks, I have now successfully installed it. It works fine with this format of data:
{ "type": "Feature", "properties": { "id": 1.0, "osm_id": 4757536.0, "name": null, "type": "taxiway" }, "geometry": { "type": "LineString", "coordinates": [ [ 33.284198244997214, 35.144497784256515 ], [ 33.282674834095417, 35.143663533433646 ] ] } } { "type": "Feature", "properties": { "id": 2.0, "osm_id": 5212814.0, "name": null, "type": "runway" }, "geometry": { "type": "LineString", "coordinates": [ [ 33.32026431706737, 35.11236466879344 ], [ 33.320523234056395, 35.110997748023919 ] ] } }
From what I understand, it is difficult to load a feature-collection-type geojson file from mongodb in QGIS, where one document consists of a feature collection made up by multiple points/linestrings/polygons. Please let me know your thoughts on the last one. Many thanks again for making this work.
Ok super it works for your data. (At least partialy) Yes that http://geojson.org/geojson-spec.html#geometrycollection is a real problem. QGIS allows layer to be one type only. That means we can make it only LineString layer or Multipoligon layer and so on ... After all my work I've done with QGIS I wish they are more data manipulating/driven software rather than CAD-like-drawing-board.
As a workaround I would split geometries into few layers. In future this plugin might add few different layers at once, but now it is beyond its simple design.
I am actually referring to the feature collection, which is described in section "1.1.Examples" of the same page (geojson.org website). In this case, a feature collection consisting of multiple features is loaded into mongo as one document. GeoJSON files consisting of a feature collection can easily be loaded (drag-and-drop) and read in QGIS. The issue I am facing, is how to visualize this type of data from MongoDB to QGIS, because most GeoJSON files can be found as feature collections.
Oh I see! It think it would be not what it meant to be. A single document in mongo is limited in size and considered approach would limit drastically size of geojson data that can be stored. Another example. If one keeps data in mongoldb that's probably because of some map-reduce or other data processing features mongo provides. This is only/mostly useful if every feature is in other document. Finally geojson file format is supported (but edit) by QGIS just by drag-and-drop file into QGIS window (layers panel). So no need for mongo here only as an tool of other type.
Closing ticket now. Vote 5 stars for a plugin if You wish.
Hello,
I want to ask if it's possible to load a collection of which the documents have the coordinates field embedded in them. For example, I have loaded a GeoJSON file in a collection in MongoDB, is it possible to then add this collection using the plugin in QGIS?
Thanks