Working with complex JSON attributes in QGIS The 2019 Stack Overflow Developer Survey Results...

Did Scotland spend $250,000 for the slogan "Welcome to Scotland"?

Why did Acorn's A3000 have red function keys?

Origin of "cooter" meaning "vagina"

FPGA - DIY Programming

What is the accessibility of a package's `Private` context variables?

Loose spokes after only a few rides

Can a rogue use sneak attack with weapons that have the thrown property even if they are not thrown?

Write faster on AT24C32

What does ひと匙 mean in this manga and has it been used colloquially?

Can someone be penalized for an "unlawful" act if no penalty is specified?

Delete all lines which don't have n characters before delimiter

Right tool to dig six foot holes?

What to do when moving next to a bird sanctuary with a loosely-domesticated cat?

Output the Arecibo Message

Am I thawing this London Broil safely?

One word riddle: Vowel in the middle

For what reasons would an animal species NOT cross a *horizontal* land bridge?

Geography at the pixel level

What tool would a Roman-age civilization have for the breaking of silver and other metals into dust?

Can a flute soloist sit?

If I score a critical hit on an 18 or higher, what are my chances of getting a critical hit if I roll 3d20?

What did it mean to "align" a radio?

Why is the maximum length of OpenWrt’s root password 8 characters?

What is the closest word meaning "respect for time / mindful"



Working with complex JSON attributes in QGIS



The 2019 Stack Overflow Developer Survey Results Are InHow do “join field” and “target field” work?How do I parse complex json?Trouble calculating areas in QGIS using field calculatorJSON visualisation in QGISTransforming lines to polygons not working in QGIS?Best data provider for calculations in large vector filesLink raster (.tiff) with attribute table (.txt) in QGIS or Rjson file with geo-coordinatesWhy won't Categorized renderer see GeoPackage attributes/values?Struggling to use Field Calculator - PyQGIS





.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ margin-bottom:0;
}







7















I am a developer and have a tool that generates a geojson asset for our data team to work with using the QGIS app. Due to the original source of the data, these features have some attributes that are represented as complex hierarchical data, impossible to project into a flat schema.



We need to be able to view / edit the attribute field as effectively a JSON blob, instead of a string literal.



What facilities are available to do this in QGIS? Are there any field editing plugins that would support such a job? Ideally some kind of popup JSON editor with document format validation and collapsible nodes, similar to how Visual Studio (Code) editors work.



Alternatively some other workflow that would enable us to manage this data in an external tool and re-inject it into the source feature.



UPDATE: Got Postgres spun up and created a JSON column from an existing text column containing JSON. QGIS hides it in the attribute table. Any further recommendations on working with JSON attributes directly in the DB?










share|improve this question




















  • 1





    Sounds like jobs for postgres with JSON support postgresql.org/docs/9.4/static/datatype-json.html

    – Mapperz
    Jan 23 '18 at 16:26











  • Did look at Postgres, not sure how it would integrate with the QGIS editor, but would be an ideal situation to work with, everything centralised.

    – Tristan Rhodes
    Jan 23 '18 at 16:36











  • I'm also interested in this, but I haven't seen anything that facilitates this in QGIS. SQLite also has support for JSON, by the way: sqlite.org/json1.html

    – arjan
    Jan 23 '18 at 16:43











  • It's not the storage that's the problem, it's the editor. We effectively have a team of data engineers cleaning up geojson files and passing them over to us. I'd be happy to have this backed by a database, but we would still need rich editor support for this to be usable. Might just learn Python and write a plugin :)

    – Tristan Rhodes
    Jan 23 '18 at 16:55













  • @TristanRhodes If you do write a plugin (or find another solution), please let us know!

    – arjan
    Mar 26 '18 at 11:17


















7















I am a developer and have a tool that generates a geojson asset for our data team to work with using the QGIS app. Due to the original source of the data, these features have some attributes that are represented as complex hierarchical data, impossible to project into a flat schema.



We need to be able to view / edit the attribute field as effectively a JSON blob, instead of a string literal.



What facilities are available to do this in QGIS? Are there any field editing plugins that would support such a job? Ideally some kind of popup JSON editor with document format validation and collapsible nodes, similar to how Visual Studio (Code) editors work.



Alternatively some other workflow that would enable us to manage this data in an external tool and re-inject it into the source feature.



UPDATE: Got Postgres spun up and created a JSON column from an existing text column containing JSON. QGIS hides it in the attribute table. Any further recommendations on working with JSON attributes directly in the DB?










share|improve this question




















  • 1





    Sounds like jobs for postgres with JSON support postgresql.org/docs/9.4/static/datatype-json.html

    – Mapperz
    Jan 23 '18 at 16:26











  • Did look at Postgres, not sure how it would integrate with the QGIS editor, but would be an ideal situation to work with, everything centralised.

    – Tristan Rhodes
    Jan 23 '18 at 16:36











  • I'm also interested in this, but I haven't seen anything that facilitates this in QGIS. SQLite also has support for JSON, by the way: sqlite.org/json1.html

    – arjan
    Jan 23 '18 at 16:43











  • It's not the storage that's the problem, it's the editor. We effectively have a team of data engineers cleaning up geojson files and passing them over to us. I'd be happy to have this backed by a database, but we would still need rich editor support for this to be usable. Might just learn Python and write a plugin :)

    – Tristan Rhodes
    Jan 23 '18 at 16:55













  • @TristanRhodes If you do write a plugin (or find another solution), please let us know!

    – arjan
    Mar 26 '18 at 11:17














7












7








7


1






I am a developer and have a tool that generates a geojson asset for our data team to work with using the QGIS app. Due to the original source of the data, these features have some attributes that are represented as complex hierarchical data, impossible to project into a flat schema.



We need to be able to view / edit the attribute field as effectively a JSON blob, instead of a string literal.



What facilities are available to do this in QGIS? Are there any field editing plugins that would support such a job? Ideally some kind of popup JSON editor with document format validation and collapsible nodes, similar to how Visual Studio (Code) editors work.



Alternatively some other workflow that would enable us to manage this data in an external tool and re-inject it into the source feature.



UPDATE: Got Postgres spun up and created a JSON column from an existing text column containing JSON. QGIS hides it in the attribute table. Any further recommendations on working with JSON attributes directly in the DB?










share|improve this question
















I am a developer and have a tool that generates a geojson asset for our data team to work with using the QGIS app. Due to the original source of the data, these features have some attributes that are represented as complex hierarchical data, impossible to project into a flat schema.



We need to be able to view / edit the attribute field as effectively a JSON blob, instead of a string literal.



What facilities are available to do this in QGIS? Are there any field editing plugins that would support such a job? Ideally some kind of popup JSON editor with document format validation and collapsible nodes, similar to how Visual Studio (Code) editors work.



Alternatively some other workflow that would enable us to manage this data in an external tool and re-inject it into the source feature.



UPDATE: Got Postgres spun up and created a JSON column from an existing text column containing JSON. QGIS hides it in the attribute table. Any further recommendations on working with JSON attributes directly in the DB?







qgis json






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Jan 23 '18 at 22:51







Tristan Rhodes

















asked Jan 23 '18 at 16:14









Tristan RhodesTristan Rhodes

362




362








  • 1





    Sounds like jobs for postgres with JSON support postgresql.org/docs/9.4/static/datatype-json.html

    – Mapperz
    Jan 23 '18 at 16:26











  • Did look at Postgres, not sure how it would integrate with the QGIS editor, but would be an ideal situation to work with, everything centralised.

    – Tristan Rhodes
    Jan 23 '18 at 16:36











  • I'm also interested in this, but I haven't seen anything that facilitates this in QGIS. SQLite also has support for JSON, by the way: sqlite.org/json1.html

    – arjan
    Jan 23 '18 at 16:43











  • It's not the storage that's the problem, it's the editor. We effectively have a team of data engineers cleaning up geojson files and passing them over to us. I'd be happy to have this backed by a database, but we would still need rich editor support for this to be usable. Might just learn Python and write a plugin :)

    – Tristan Rhodes
    Jan 23 '18 at 16:55













  • @TristanRhodes If you do write a plugin (or find another solution), please let us know!

    – arjan
    Mar 26 '18 at 11:17














  • 1





    Sounds like jobs for postgres with JSON support postgresql.org/docs/9.4/static/datatype-json.html

    – Mapperz
    Jan 23 '18 at 16:26











  • Did look at Postgres, not sure how it would integrate with the QGIS editor, but would be an ideal situation to work with, everything centralised.

    – Tristan Rhodes
    Jan 23 '18 at 16:36











  • I'm also interested in this, but I haven't seen anything that facilitates this in QGIS. SQLite also has support for JSON, by the way: sqlite.org/json1.html

    – arjan
    Jan 23 '18 at 16:43











  • It's not the storage that's the problem, it's the editor. We effectively have a team of data engineers cleaning up geojson files and passing them over to us. I'd be happy to have this backed by a database, but we would still need rich editor support for this to be usable. Might just learn Python and write a plugin :)

    – Tristan Rhodes
    Jan 23 '18 at 16:55













  • @TristanRhodes If you do write a plugin (or find another solution), please let us know!

    – arjan
    Mar 26 '18 at 11:17








1




1





Sounds like jobs for postgres with JSON support postgresql.org/docs/9.4/static/datatype-json.html

– Mapperz
Jan 23 '18 at 16:26





Sounds like jobs for postgres with JSON support postgresql.org/docs/9.4/static/datatype-json.html

– Mapperz
Jan 23 '18 at 16:26













Did look at Postgres, not sure how it would integrate with the QGIS editor, but would be an ideal situation to work with, everything centralised.

– Tristan Rhodes
Jan 23 '18 at 16:36





Did look at Postgres, not sure how it would integrate with the QGIS editor, but would be an ideal situation to work with, everything centralised.

– Tristan Rhodes
Jan 23 '18 at 16:36













I'm also interested in this, but I haven't seen anything that facilitates this in QGIS. SQLite also has support for JSON, by the way: sqlite.org/json1.html

– arjan
Jan 23 '18 at 16:43





I'm also interested in this, but I haven't seen anything that facilitates this in QGIS. SQLite also has support for JSON, by the way: sqlite.org/json1.html

– arjan
Jan 23 '18 at 16:43













It's not the storage that's the problem, it's the editor. We effectively have a team of data engineers cleaning up geojson files and passing them over to us. I'd be happy to have this backed by a database, but we would still need rich editor support for this to be usable. Might just learn Python and write a plugin :)

– Tristan Rhodes
Jan 23 '18 at 16:55







It's not the storage that's the problem, it's the editor. We effectively have a team of data engineers cleaning up geojson files and passing them over to us. I'd be happy to have this backed by a database, but we would still need rich editor support for this to be usable. Might just learn Python and write a plugin :)

– Tristan Rhodes
Jan 23 '18 at 16:55















@TristanRhodes If you do write a plugin (or find another solution), please let us know!

– arjan
Mar 26 '18 at 11:17





@TristanRhodes If you do write a plugin (or find another solution), please let us know!

– arjan
Mar 26 '18 at 11:17










2 Answers
2






active

oldest

votes


















2














Check this: https://github.com/qgis/QGIS/pull/7869
Now the json/jsonb type attributes are visible using QGIS 3.3.0 Nighly (master dev version)






share|improve this answer































    0














    In recent QGIS versions (> 3.3), if you have a JSON field in a PostgreSQL database, you can use the map_get function anywhere with the Expression Dialog to extract a specific value.



    E.g if you have a JSON field called "extraData" and the contents are:



    { 
    "param1": "Some string",
    "param2": "Another string"
    }


    then
    map_get(extraData,'param1') would produce Some string



    I suppose (though I haven't tried it) you can recursively use the function to retrieve deeply nested values.



    There are other functions such as the from_json function that returns the entire contents. Take a look at the Maps section inside the Expression Dialog.





    share
























      Your Answer








      StackExchange.ready(function() {
      var channelOptions = {
      tags: "".split(" "),
      id: "79"
      };
      initTagRenderer("".split(" "), "".split(" "), channelOptions);

      StackExchange.using("externalEditor", function() {
      // Have to fire editor after snippets, if snippets enabled
      if (StackExchange.settings.snippets.snippetsEnabled) {
      StackExchange.using("snippets", function() {
      createEditor();
      });
      }
      else {
      createEditor();
      }
      });

      function createEditor() {
      StackExchange.prepareEditor({
      heartbeatType: 'answer',
      autoActivateHeartbeat: false,
      convertImagesToLinks: false,
      noModals: true,
      showLowRepImageUploadWarning: true,
      reputationToPostImages: null,
      bindNavPrevention: true,
      postfix: "",
      imageUploader: {
      brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
      contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
      allowUrls: true
      },
      onDemand: true,
      discardSelector: ".discard-answer"
      ,immediatelyShowMarkdownHelp:true
      });


      }
      });














      draft saved

      draft discarded


















      StackExchange.ready(
      function () {
      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fgis.stackexchange.com%2fquestions%2f268958%2fworking-with-complex-json-attributes-in-qgis%23new-answer', 'question_page');
      }
      );

      Post as a guest















      Required, but never shown

























      2 Answers
      2






      active

      oldest

      votes








      2 Answers
      2






      active

      oldest

      votes









      active

      oldest

      votes






      active

      oldest

      votes









      2














      Check this: https://github.com/qgis/QGIS/pull/7869
      Now the json/jsonb type attributes are visible using QGIS 3.3.0 Nighly (master dev version)






      share|improve this answer




























        2














        Check this: https://github.com/qgis/QGIS/pull/7869
        Now the json/jsonb type attributes are visible using QGIS 3.3.0 Nighly (master dev version)






        share|improve this answer


























          2












          2








          2







          Check this: https://github.com/qgis/QGIS/pull/7869
          Now the json/jsonb type attributes are visible using QGIS 3.3.0 Nighly (master dev version)






          share|improve this answer













          Check this: https://github.com/qgis/QGIS/pull/7869
          Now the json/jsonb type attributes are visible using QGIS 3.3.0 Nighly (master dev version)







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Sep 17 '18 at 8:32









          Antonio Armas DíazAntonio Armas Díaz

          816




          816

























              0














              In recent QGIS versions (> 3.3), if you have a JSON field in a PostgreSQL database, you can use the map_get function anywhere with the Expression Dialog to extract a specific value.



              E.g if you have a JSON field called "extraData" and the contents are:



              { 
              "param1": "Some string",
              "param2": "Another string"
              }


              then
              map_get(extraData,'param1') would produce Some string



              I suppose (though I haven't tried it) you can recursively use the function to retrieve deeply nested values.



              There are other functions such as the from_json function that returns the entire contents. Take a look at the Maps section inside the Expression Dialog.





              share




























                0














                In recent QGIS versions (> 3.3), if you have a JSON field in a PostgreSQL database, you can use the map_get function anywhere with the Expression Dialog to extract a specific value.



                E.g if you have a JSON field called "extraData" and the contents are:



                { 
                "param1": "Some string",
                "param2": "Another string"
                }


                then
                map_get(extraData,'param1') would produce Some string



                I suppose (though I haven't tried it) you can recursively use the function to retrieve deeply nested values.



                There are other functions such as the from_json function that returns the entire contents. Take a look at the Maps section inside the Expression Dialog.





                share


























                  0












                  0








                  0







                  In recent QGIS versions (> 3.3), if you have a JSON field in a PostgreSQL database, you can use the map_get function anywhere with the Expression Dialog to extract a specific value.



                  E.g if you have a JSON field called "extraData" and the contents are:



                  { 
                  "param1": "Some string",
                  "param2": "Another string"
                  }


                  then
                  map_get(extraData,'param1') would produce Some string



                  I suppose (though I haven't tried it) you can recursively use the function to retrieve deeply nested values.



                  There are other functions such as the from_json function that returns the entire contents. Take a look at the Maps section inside the Expression Dialog.





                  share













                  In recent QGIS versions (> 3.3), if you have a JSON field in a PostgreSQL database, you can use the map_get function anywhere with the Expression Dialog to extract a specific value.



                  E.g if you have a JSON field called "extraData" and the contents are:



                  { 
                  "param1": "Some string",
                  "param2": "Another string"
                  }


                  then
                  map_get(extraData,'param1') would produce Some string



                  I suppose (though I haven't tried it) you can recursively use the function to retrieve deeply nested values.



                  There are other functions such as the from_json function that returns the entire contents. Take a look at the Maps section inside the Expression Dialog.






                  share











                  share


                  share










                  answered 2 mins ago









                  TheVRChrisTheVRChris

                  213




                  213






























                      draft saved

                      draft discarded




















































                      Thanks for contributing an answer to Geographic Information Systems Stack Exchange!


                      • Please be sure to answer the question. Provide details and share your research!

                      But avoid



                      • Asking for help, clarification, or responding to other answers.

                      • Making statements based on opinion; back them up with references or personal experience.


                      To learn more, see our tips on writing great answers.




                      draft saved


                      draft discarded














                      StackExchange.ready(
                      function () {
                      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fgis.stackexchange.com%2fquestions%2f268958%2fworking-with-complex-json-attributes-in-qgis%23new-answer', 'question_page');
                      }
                      );

                      Post as a guest















                      Required, but never shown





















































                      Required, but never shown














                      Required, but never shown












                      Required, but never shown







                      Required, but never shown

































                      Required, but never shown














                      Required, but never shown












                      Required, but never shown







                      Required, but never shown







                      Popular posts from this blog

                      Щит и меч (фильм) Содержание Названия серий | Сюжет |...

                      is 'sed' thread safeWhat should someone know about using Python scripts in the shell?Nexenta bash script uses...

                      Meter-Bus Содержание Параметры шины | Стандартизация |...