Clipping and merging tiles using GDAL based on bounding box from PostGIS?Merging GDAL tiles and crop via...

Does resurrection consume material components if the target isn’t willing to be resurrected?

Is there any danger of my neighbor having my wife's signature?

What if you do not believe in the project benefits?

Which was the first story to feature space elevators?

How can I portray body horror and still be sensitive to people with disabilities?

How do I add a strong "onion flavor" to the biryani (in restaurant style)?

Why is quixotic not Quixotic (a proper adjective)?

The Late Queen Gives in to Remorse - Reverse Hangman

我可不觉得 - agree or disagree?

Last Reboot commands don't agree

Can I legally make a website about boycotting a certain company?

Sauna: Wood does not feel so hot

How can I make my enemies feel real and make combat more engaging?

Cryptic cross... with words

Distortion of City -Boundary-Polygons proportional to population size in QGIS?

How can guns be countered by melee combat without raw-ability or exceptional explanations?

Why write a book when there's a movie in my head?

Multiple null checks in Java 8

What happens if you declare more than $10,000 at the US border?

Short story where Earth is given a racist governor who likes species of a certain color

How do I handle a blinded enemy which wants to attack someone it's sure is there?

Why would you use 2 alternate layout buttons instead of 1, when only one can be selected at once

What does an unprocessed RAW file look like?

Can a planet be tidally unlocked?



Clipping and merging tiles using GDAL based on bounding box from PostGIS?


Merging GDAL tiles and crop via bounding box?Some tiff not included on a vrt indexDynamically trimming informational border off of FAA sectional raster charts?How do I get the vector and raster metadata from a PostGIS database?Determining if shapefile and raster overlap in Python using OGR/GDAL?PostGIS Out of db VRT containing JPEG2000 GDAL 2.1 OpenJPEGMerging GDAL tiles and crop via bounding box?Reprojecting and splitting in tiles with gdalCreating a geoTIFF from PostGIS raster columnHow to import OSM data into postgis and add Elevation Information from rasterSelecting lines from first table based on bounding Box of second table in PostGIS













1















I have a set of polygons in PostGIS DB.



I also have a set of GeoTIFF files.



I would like to know what is the best way (using GDAL) to get one polygon from DB (based on SQL Query) and then take all TIFF files that intersect with that polygon, clip those that need to be cut and merge result into one TIFF file.



I found method here:
Merging GDAL tiles and crop via bounding box?



So I have that VRT file already but I don't know how to get that KML file or maybe I can simply replace is somehow with SQL Query to PostGIS to take that clipper?










share|improve this question





























    1















    I have a set of polygons in PostGIS DB.



    I also have a set of GeoTIFF files.



    I would like to know what is the best way (using GDAL) to get one polygon from DB (based on SQL Query) and then take all TIFF files that intersect with that polygon, clip those that need to be cut and merge result into one TIFF file.



    I found method here:
    Merging GDAL tiles and crop via bounding box?



    So I have that VRT file already but I don't know how to get that KML file or maybe I can simply replace is somehow with SQL Query to PostGIS to take that clipper?










    share|improve this question



























      1












      1








      1








      I have a set of polygons in PostGIS DB.



      I also have a set of GeoTIFF files.



      I would like to know what is the best way (using GDAL) to get one polygon from DB (based on SQL Query) and then take all TIFF files that intersect with that polygon, clip those that need to be cut and merge result into one TIFF file.



      I found method here:
      Merging GDAL tiles and crop via bounding box?



      So I have that VRT file already but I don't know how to get that KML file or maybe I can simply replace is somehow with SQL Query to PostGIS to take that clipper?










      share|improve this question
















      I have a set of polygons in PostGIS DB.



      I also have a set of GeoTIFF files.



      I would like to know what is the best way (using GDAL) to get one polygon from DB (based on SQL Query) and then take all TIFF files that intersect with that polygon, clip those that need to be cut and merge result into one TIFF file.



      I found method here:
      Merging GDAL tiles and crop via bounding box?



      So I have that VRT file already but I don't know how to get that KML file or maybe I can simply replace is somehow with SQL Query to PostGIS to take that clipper?







      postgis gdal






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited 3 hours ago









      Vince

      14.6k32748




      14.6k32748










      asked 4 hours ago









      WitosWitos

      161




      161






















          1 Answer
          1






          active

          oldest

          votes


















          0














          One solution involving PostGIS and GDAL would be to:



          1) Load the rasters into PostGIS using raster2pgsql



          2) Clip them with ST_Clip()



          3) Merge clipped rasters with ST_Union()



          4) Export the result to the filesystem as a new raster with gdal_translate



          You can do 1) and 2) as one single ST_Union(ST_Clip()) query.






          share|improve this answer























            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%2f313048%2fclipping-and-merging-tiles-using-gdal-based-on-bounding-box-from-postgis%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









            0














            One solution involving PostGIS and GDAL would be to:



            1) Load the rasters into PostGIS using raster2pgsql



            2) Clip them with ST_Clip()



            3) Merge clipped rasters with ST_Union()



            4) Export the result to the filesystem as a new raster with gdal_translate



            You can do 1) and 2) as one single ST_Union(ST_Clip()) query.






            share|improve this answer




























              0














              One solution involving PostGIS and GDAL would be to:



              1) Load the rasters into PostGIS using raster2pgsql



              2) Clip them with ST_Clip()



              3) Merge clipped rasters with ST_Union()



              4) Export the result to the filesystem as a new raster with gdal_translate



              You can do 1) and 2) as one single ST_Union(ST_Clip()) query.






              share|improve this answer


























                0












                0








                0







                One solution involving PostGIS and GDAL would be to:



                1) Load the rasters into PostGIS using raster2pgsql



                2) Clip them with ST_Clip()



                3) Merge clipped rasters with ST_Union()



                4) Export the result to the filesystem as a new raster with gdal_translate



                You can do 1) and 2) as one single ST_Union(ST_Clip()) query.






                share|improve this answer













                One solution involving PostGIS and GDAL would be to:



                1) Load the rasters into PostGIS using raster2pgsql



                2) Clip them with ST_Clip()



                3) Merge clipped rasters with ST_Union()



                4) Export the result to the filesystem as a new raster with gdal_translate



                You can do 1) and 2) as one single ST_Union(ST_Clip()) query.







                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered 1 hour ago









                Pierre RacinePierre Racine

                1,47688




                1,47688






























                    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%2f313048%2fclipping-and-merging-tiles-using-gdal-based-on-bounding-box-from-postgis%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

                    (145452) 2005 RN43 Классификация | Примечания | Ссылки |...

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

                    Энтрерриос (город) Содержание История | Географическое...