What is the proper type for columns holding GeoJSON?












3















What data type do you prefer for columns holding GeoJSON information, in the major RDBMS families (i.e. Oracle DB, PostgreSQL, MySQL, SQL Server, SQLite, DB2..?



In general, do you prefer / is better using large object columns (e.g. CLOB of Oracle DB) or do you prefer / is better using data types from the character / text family (e.g. text in PostgreSQL or character varying (with unspecified length) in PostgreSQL too)?



Can you be so clever, experienced or knowledgeable even to assert whether the answer depends on the max GeoJSON character length in the table, or not? or maybe the median value or something else?



Spoiler for X/Y problem fans follows!




For the X/Y problem fans, my X question to this Y question would be:
Which is the proper way of migrating data held in Oracle spatial in production to PostGIS?, but I guess the answer to my X question is kind of a time evolving one, while I guess the answer to my Y question is more of a constant (even almost axiomatic) one.




I would have created the geojson tag if I already could, but I can not yet so I tag as JSON.










share|improve this question

























  • Upgrading from Oracle to PostGIS is totally cool, but I would drop the shout out to every other database. That makes this not a Q/A but a polling question. Consider making the question specific to PostgreSQL and Oracle.

    – Evan Carroll
    May 17 '17 at 18:35
















3















What data type do you prefer for columns holding GeoJSON information, in the major RDBMS families (i.e. Oracle DB, PostgreSQL, MySQL, SQL Server, SQLite, DB2..?



In general, do you prefer / is better using large object columns (e.g. CLOB of Oracle DB) or do you prefer / is better using data types from the character / text family (e.g. text in PostgreSQL or character varying (with unspecified length) in PostgreSQL too)?



Can you be so clever, experienced or knowledgeable even to assert whether the answer depends on the max GeoJSON character length in the table, or not? or maybe the median value or something else?



Spoiler for X/Y problem fans follows!




For the X/Y problem fans, my X question to this Y question would be:
Which is the proper way of migrating data held in Oracle spatial in production to PostGIS?, but I guess the answer to my X question is kind of a time evolving one, while I guess the answer to my Y question is more of a constant (even almost axiomatic) one.




I would have created the geojson tag if I already could, but I can not yet so I tag as JSON.










share|improve this question

























  • Upgrading from Oracle to PostGIS is totally cool, but I would drop the shout out to every other database. That makes this not a Q/A but a polling question. Consider making the question specific to PostgreSQL and Oracle.

    – Evan Carroll
    May 17 '17 at 18:35














3












3








3








What data type do you prefer for columns holding GeoJSON information, in the major RDBMS families (i.e. Oracle DB, PostgreSQL, MySQL, SQL Server, SQLite, DB2..?



In general, do you prefer / is better using large object columns (e.g. CLOB of Oracle DB) or do you prefer / is better using data types from the character / text family (e.g. text in PostgreSQL or character varying (with unspecified length) in PostgreSQL too)?



Can you be so clever, experienced or knowledgeable even to assert whether the answer depends on the max GeoJSON character length in the table, or not? or maybe the median value or something else?



Spoiler for X/Y problem fans follows!




For the X/Y problem fans, my X question to this Y question would be:
Which is the proper way of migrating data held in Oracle spatial in production to PostGIS?, but I guess the answer to my X question is kind of a time evolving one, while I guess the answer to my Y question is more of a constant (even almost axiomatic) one.




I would have created the geojson tag if I already could, but I can not yet so I tag as JSON.










share|improve this question
















What data type do you prefer for columns holding GeoJSON information, in the major RDBMS families (i.e. Oracle DB, PostgreSQL, MySQL, SQL Server, SQLite, DB2..?



In general, do you prefer / is better using large object columns (e.g. CLOB of Oracle DB) or do you prefer / is better using data types from the character / text family (e.g. text in PostgreSQL or character varying (with unspecified length) in PostgreSQL too)?



Can you be so clever, experienced or knowledgeable even to assert whether the answer depends on the max GeoJSON character length in the table, or not? or maybe the median value or something else?



Spoiler for X/Y problem fans follows!




For the X/Y problem fans, my X question to this Y question would be:
Which is the proper way of migrating data held in Oracle spatial in production to PostGIS?, but I guess the answer to my X question is kind of a time evolving one, while I guess the answer to my Y question is more of a constant (even almost axiomatic) one.




I would have created the geojson tag if I already could, but I can not yet so I tag as JSON.







migration json spatial geojson






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited 5 hours ago









Evan Carroll

31.6k965213




31.6k965213










asked May 17 '17 at 18:09









upregouprego

3011316




3011316













  • Upgrading from Oracle to PostGIS is totally cool, but I would drop the shout out to every other database. That makes this not a Q/A but a polling question. Consider making the question specific to PostgreSQL and Oracle.

    – Evan Carroll
    May 17 '17 at 18:35



















  • Upgrading from Oracle to PostGIS is totally cool, but I would drop the shout out to every other database. That makes this not a Q/A but a polling question. Consider making the question specific to PostgreSQL and Oracle.

    – Evan Carroll
    May 17 '17 at 18:35

















Upgrading from Oracle to PostGIS is totally cool, but I would drop the shout out to every other database. That makes this not a Q/A but a polling question. Consider making the question specific to PostgreSQL and Oracle.

– Evan Carroll
May 17 '17 at 18:35





Upgrading from Oracle to PostGIS is totally cool, but I would drop the shout out to every other database. That makes this not a Q/A but a polling question. Consider making the question specific to PostgreSQL and Oracle.

– Evan Carroll
May 17 '17 at 18:35










1 Answer
1






active

oldest

votes


















2















What is the proper type for columns holding GeoJSON?




In PostgreSQL, as JSONB (ideally), or JSON.




Which is the proper way of migrating data held in Oracle spatial in production to PostGIS?




As "Well-Known Binary", (WKB) using Get_WKB. Or simply using oracle_fdw which solves most of these problems and uses WKB behind the scenes.




The only supported geometry types are POINT, LINE, POLYGON, MULTIPOINT, MULTILINE and MULTIPOLYGON in two and three dimensions. Empty PostGIS geometries are not supported because they have no equivalent in Oracle Spatial.




Moreover on the subject of GeoJSON, PostGIS provides ST_GeomFromGeoJSON, and ST_AsGeoJSON if you want to use GeoJSON.






share|improve this answer

























    Your Answer








    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "182"
    };
    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%2fdba.stackexchange.com%2fquestions%2f173856%2fwhat-is-the-proper-type-for-columns-holding-geojson%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    2















    What is the proper type for columns holding GeoJSON?




    In PostgreSQL, as JSONB (ideally), or JSON.




    Which is the proper way of migrating data held in Oracle spatial in production to PostGIS?




    As "Well-Known Binary", (WKB) using Get_WKB. Or simply using oracle_fdw which solves most of these problems and uses WKB behind the scenes.




    The only supported geometry types are POINT, LINE, POLYGON, MULTIPOINT, MULTILINE and MULTIPOLYGON in two and three dimensions. Empty PostGIS geometries are not supported because they have no equivalent in Oracle Spatial.




    Moreover on the subject of GeoJSON, PostGIS provides ST_GeomFromGeoJSON, and ST_AsGeoJSON if you want to use GeoJSON.






    share|improve this answer






























      2















      What is the proper type for columns holding GeoJSON?




      In PostgreSQL, as JSONB (ideally), or JSON.




      Which is the proper way of migrating data held in Oracle spatial in production to PostGIS?




      As "Well-Known Binary", (WKB) using Get_WKB. Or simply using oracle_fdw which solves most of these problems and uses WKB behind the scenes.




      The only supported geometry types are POINT, LINE, POLYGON, MULTIPOINT, MULTILINE and MULTIPOLYGON in two and three dimensions. Empty PostGIS geometries are not supported because they have no equivalent in Oracle Spatial.




      Moreover on the subject of GeoJSON, PostGIS provides ST_GeomFromGeoJSON, and ST_AsGeoJSON if you want to use GeoJSON.






      share|improve this answer




























        2












        2








        2








        What is the proper type for columns holding GeoJSON?




        In PostgreSQL, as JSONB (ideally), or JSON.




        Which is the proper way of migrating data held in Oracle spatial in production to PostGIS?




        As "Well-Known Binary", (WKB) using Get_WKB. Or simply using oracle_fdw which solves most of these problems and uses WKB behind the scenes.




        The only supported geometry types are POINT, LINE, POLYGON, MULTIPOINT, MULTILINE and MULTIPOLYGON in two and three dimensions. Empty PostGIS geometries are not supported because they have no equivalent in Oracle Spatial.




        Moreover on the subject of GeoJSON, PostGIS provides ST_GeomFromGeoJSON, and ST_AsGeoJSON if you want to use GeoJSON.






        share|improve this answer
















        What is the proper type for columns holding GeoJSON?




        In PostgreSQL, as JSONB (ideally), or JSON.




        Which is the proper way of migrating data held in Oracle spatial in production to PostGIS?




        As "Well-Known Binary", (WKB) using Get_WKB. Or simply using oracle_fdw which solves most of these problems and uses WKB behind the scenes.




        The only supported geometry types are POINT, LINE, POLYGON, MULTIPOINT, MULTILINE and MULTIPOLYGON in two and three dimensions. Empty PostGIS geometries are not supported because they have no equivalent in Oracle Spatial.




        Moreover on the subject of GeoJSON, PostGIS provides ST_GeomFromGeoJSON, and ST_AsGeoJSON if you want to use GeoJSON.







        share|improve this answer














        share|improve this answer



        share|improve this answer








        edited 5 hours ago

























        answered May 17 '17 at 18:32









        Evan CarrollEvan Carroll

        31.6k965213




        31.6k965213






























            draft saved

            draft discarded




















































            Thanks for contributing an answer to Database Administrators 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%2fdba.stackexchange.com%2fquestions%2f173856%2fwhat-is-the-proper-type-for-columns-holding-geojson%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

            الفوسفات في المغرب

            Four equal circles intersect: What is the area of the small shaded portion and its height

            جامعة ليفربول