Using ST_Intersection with three or more tablesHow to update attribute values of points outside an...

My story is written in English, but is set in my home country. What language should I use for the dialogue?

Can "semicircle" be used to refer to a part-circle that is not a exact half-circle?

Who is our nearest neighbor

Co-worker team leader wants to inject the crap software product of his friends into our development. What should I say to our common boss?

Format picture and text with TikZ and minipage

What exactly is the purpose of connection links straped between the rocket and the launch pad

Why does Deadpool say "You're welcome, Canada," after shooting Ryan Reynolds in the end credits?

Life insurance that covers only simultaneous/dual deaths

A curious inequality concerning binomial coefficients

Can't remove a file with file mode bits a+rw

This equation is outside the page, how to modify it

Is King K. Rool's down throw to up-special a true combo?

Block storage rewrites

How could a female member of a species produce eggs unto death?

Unreachable code, but reachable with exception

If the Captain's screens are out, does he switch seats with the co-pilot?

Do I need to leave some extra space available on the disk which my database log files reside, for log backup operations to successfully occur?

Should we release the security issues we found in our product as CVE or we can just update those on weekly release notes?

What is the definition of "Natural Selection"?

Single word request: Harming the benefactor

Why do Australian milk farmers need to protest supermarkets' milk price?

Am I not good enough for you?

Best approach to update all entries in a list that is paginated?

validation vs test vs training accuracy, which one to compare for claiming overfit?



Using ST_Intersection with three or more tables


How to update attribute values of points outside an area?Merging polygons for rendering with GeoserverCutting linestrings with points?ST_Intersection between MultiPolygon tables leads to gaps, missing intersectionsST_Difference on linestrings and polygons slow and failsUsing ST_Intersection with two rasters?Listing results of many ST_Intersects in one table?Difference between PostGIS ST_Intersects vs '=', QGIS and ArcGIS 'select by location'Intersection between an angle and a polygon (postgreSQL + postGIS or Python2.7 + shapely + psycopg2)Aggregate version of ST_Intersection













0















I'm trying to achieve a multiple-table intersect with PostGIS while retaining the geom for each shape.



For any given property shape, I want individual cuts of that shape split apart by different characteristics of the below layers.



So for example:



480128 | 3Sh3W | Otamatea | MOZ | S | 2 | B' | 5 | P 5 | geom
480128 | 3Sh3W | Turangai| MOZ | L/S | 2 | B' | 5 | P 5 | geom
480128 | 3Sh3W | Makahu | ZOT | L/S | 2 | B' | 5 | P 5 | geom


The SQL I've used so far is:



CREATE TABLE sd_processed AS 
SELECT
A.title_no,
B.erosion,
C.series,
C.domnzsc nzsc,
C.ps,
D.prd_class as prd,
E.slope as slope,
F.drain_clas as drain,
G.veg,
ST_DUMP(ST_INTERSECTION(
A.geom,
ST_INTERSECTION(A.geom,
ST_INTERSECTION(B.geom,
ST_INTERSECTION(C.geom,
ST_INTERSECTION(D.geom,
ST_INTERSECTION(E.geom,
ST_INTERSECTION(F.geom, G.geom)
)
)
)
)
)
)) geom
FROM
sd_title A,
sd_erosion B,
sd_particle_size C,
sd_potential_rooting_depth D,
sd_slope E,
sd_soil_drainage F,
sd_vegetation G
WHERE
ST_INTERSECTS(A.geom, B.geom) = true
AND ST_INTERSECTS(A.geom, C.geom) = true
AND ST_INTERSECTS(A.geom, D.geom) = true
AND ST_INTERSECTS(A.geom, E.geom) = true
AND ST_INTERSECTS(A.geom, F.geom) = true
AND ST_INTERSECTS(A.geom, G.geom) = true
AND ST_INTERSECTS(B.geom, C.geom) = true
AND ST_INTERSECTS(B.geom, D.geom) = true
AND ST_INTERSECTS(B.geom, E.geom) = true
AND ST_INTERSECTS(B.geom, F.geom) = true
AND ST_INTERSECTS(B.geom, G.geom) = true
AND ST_INTERSECTS(C.geom, D.geom) = true
AND ST_INTERSECTS(C.geom, E.geom) = true
AND ST_INTERSECTS(C.geom, F.geom) = true
AND ST_INTERSECTS(C.geom, G.geom) = true
AND ST_INTERSECTS(D.geom, E.geom) = true
AND ST_INTERSECTS(D.geom, F.geom) = true
AND ST_INTERSECTS(D.geom, G.geom) = true
AND ST_INTERSECTS(E.geom, F.geom) = true
AND ST_INTERSECTS(E.geom, G.geom) = true
AND ST_INTERSECTS(F.geom, G.geom) = true
LIMIT 1000;








share







New contributor




andryo is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.

























    0















    I'm trying to achieve a multiple-table intersect with PostGIS while retaining the geom for each shape.



    For any given property shape, I want individual cuts of that shape split apart by different characteristics of the below layers.



    So for example:



    480128 | 3Sh3W | Otamatea | MOZ | S | 2 | B' | 5 | P 5 | geom
    480128 | 3Sh3W | Turangai| MOZ | L/S | 2 | B' | 5 | P 5 | geom
    480128 | 3Sh3W | Makahu | ZOT | L/S | 2 | B' | 5 | P 5 | geom


    The SQL I've used so far is:



    CREATE TABLE sd_processed AS 
    SELECT
    A.title_no,
    B.erosion,
    C.series,
    C.domnzsc nzsc,
    C.ps,
    D.prd_class as prd,
    E.slope as slope,
    F.drain_clas as drain,
    G.veg,
    ST_DUMP(ST_INTERSECTION(
    A.geom,
    ST_INTERSECTION(A.geom,
    ST_INTERSECTION(B.geom,
    ST_INTERSECTION(C.geom,
    ST_INTERSECTION(D.geom,
    ST_INTERSECTION(E.geom,
    ST_INTERSECTION(F.geom, G.geom)
    )
    )
    )
    )
    )
    )) geom
    FROM
    sd_title A,
    sd_erosion B,
    sd_particle_size C,
    sd_potential_rooting_depth D,
    sd_slope E,
    sd_soil_drainage F,
    sd_vegetation G
    WHERE
    ST_INTERSECTS(A.geom, B.geom) = true
    AND ST_INTERSECTS(A.geom, C.geom) = true
    AND ST_INTERSECTS(A.geom, D.geom) = true
    AND ST_INTERSECTS(A.geom, E.geom) = true
    AND ST_INTERSECTS(A.geom, F.geom) = true
    AND ST_INTERSECTS(A.geom, G.geom) = true
    AND ST_INTERSECTS(B.geom, C.geom) = true
    AND ST_INTERSECTS(B.geom, D.geom) = true
    AND ST_INTERSECTS(B.geom, E.geom) = true
    AND ST_INTERSECTS(B.geom, F.geom) = true
    AND ST_INTERSECTS(B.geom, G.geom) = true
    AND ST_INTERSECTS(C.geom, D.geom) = true
    AND ST_INTERSECTS(C.geom, E.geom) = true
    AND ST_INTERSECTS(C.geom, F.geom) = true
    AND ST_INTERSECTS(C.geom, G.geom) = true
    AND ST_INTERSECTS(D.geom, E.geom) = true
    AND ST_INTERSECTS(D.geom, F.geom) = true
    AND ST_INTERSECTS(D.geom, G.geom) = true
    AND ST_INTERSECTS(E.geom, F.geom) = true
    AND ST_INTERSECTS(E.geom, G.geom) = true
    AND ST_INTERSECTS(F.geom, G.geom) = true
    LIMIT 1000;








    share







    New contributor




    andryo is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
    Check out our Code of Conduct.























      0












      0








      0








      I'm trying to achieve a multiple-table intersect with PostGIS while retaining the geom for each shape.



      For any given property shape, I want individual cuts of that shape split apart by different characteristics of the below layers.



      So for example:



      480128 | 3Sh3W | Otamatea | MOZ | S | 2 | B' | 5 | P 5 | geom
      480128 | 3Sh3W | Turangai| MOZ | L/S | 2 | B' | 5 | P 5 | geom
      480128 | 3Sh3W | Makahu | ZOT | L/S | 2 | B' | 5 | P 5 | geom


      The SQL I've used so far is:



      CREATE TABLE sd_processed AS 
      SELECT
      A.title_no,
      B.erosion,
      C.series,
      C.domnzsc nzsc,
      C.ps,
      D.prd_class as prd,
      E.slope as slope,
      F.drain_clas as drain,
      G.veg,
      ST_DUMP(ST_INTERSECTION(
      A.geom,
      ST_INTERSECTION(A.geom,
      ST_INTERSECTION(B.geom,
      ST_INTERSECTION(C.geom,
      ST_INTERSECTION(D.geom,
      ST_INTERSECTION(E.geom,
      ST_INTERSECTION(F.geom, G.geom)
      )
      )
      )
      )
      )
      )) geom
      FROM
      sd_title A,
      sd_erosion B,
      sd_particle_size C,
      sd_potential_rooting_depth D,
      sd_slope E,
      sd_soil_drainage F,
      sd_vegetation G
      WHERE
      ST_INTERSECTS(A.geom, B.geom) = true
      AND ST_INTERSECTS(A.geom, C.geom) = true
      AND ST_INTERSECTS(A.geom, D.geom) = true
      AND ST_INTERSECTS(A.geom, E.geom) = true
      AND ST_INTERSECTS(A.geom, F.geom) = true
      AND ST_INTERSECTS(A.geom, G.geom) = true
      AND ST_INTERSECTS(B.geom, C.geom) = true
      AND ST_INTERSECTS(B.geom, D.geom) = true
      AND ST_INTERSECTS(B.geom, E.geom) = true
      AND ST_INTERSECTS(B.geom, F.geom) = true
      AND ST_INTERSECTS(B.geom, G.geom) = true
      AND ST_INTERSECTS(C.geom, D.geom) = true
      AND ST_INTERSECTS(C.geom, E.geom) = true
      AND ST_INTERSECTS(C.geom, F.geom) = true
      AND ST_INTERSECTS(C.geom, G.geom) = true
      AND ST_INTERSECTS(D.geom, E.geom) = true
      AND ST_INTERSECTS(D.geom, F.geom) = true
      AND ST_INTERSECTS(D.geom, G.geom) = true
      AND ST_INTERSECTS(E.geom, F.geom) = true
      AND ST_INTERSECTS(E.geom, G.geom) = true
      AND ST_INTERSECTS(F.geom, G.geom) = true
      LIMIT 1000;








      share







      New contributor




      andryo is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.












      I'm trying to achieve a multiple-table intersect with PostGIS while retaining the geom for each shape.



      For any given property shape, I want individual cuts of that shape split apart by different characteristics of the below layers.



      So for example:



      480128 | 3Sh3W | Otamatea | MOZ | S | 2 | B' | 5 | P 5 | geom
      480128 | 3Sh3W | Turangai| MOZ | L/S | 2 | B' | 5 | P 5 | geom
      480128 | 3Sh3W | Makahu | ZOT | L/S | 2 | B' | 5 | P 5 | geom


      The SQL I've used so far is:



      CREATE TABLE sd_processed AS 
      SELECT
      A.title_no,
      B.erosion,
      C.series,
      C.domnzsc nzsc,
      C.ps,
      D.prd_class as prd,
      E.slope as slope,
      F.drain_clas as drain,
      G.veg,
      ST_DUMP(ST_INTERSECTION(
      A.geom,
      ST_INTERSECTION(A.geom,
      ST_INTERSECTION(B.geom,
      ST_INTERSECTION(C.geom,
      ST_INTERSECTION(D.geom,
      ST_INTERSECTION(E.geom,
      ST_INTERSECTION(F.geom, G.geom)
      )
      )
      )
      )
      )
      )) geom
      FROM
      sd_title A,
      sd_erosion B,
      sd_particle_size C,
      sd_potential_rooting_depth D,
      sd_slope E,
      sd_soil_drainage F,
      sd_vegetation G
      WHERE
      ST_INTERSECTS(A.geom, B.geom) = true
      AND ST_INTERSECTS(A.geom, C.geom) = true
      AND ST_INTERSECTS(A.geom, D.geom) = true
      AND ST_INTERSECTS(A.geom, E.geom) = true
      AND ST_INTERSECTS(A.geom, F.geom) = true
      AND ST_INTERSECTS(A.geom, G.geom) = true
      AND ST_INTERSECTS(B.geom, C.geom) = true
      AND ST_INTERSECTS(B.geom, D.geom) = true
      AND ST_INTERSECTS(B.geom, E.geom) = true
      AND ST_INTERSECTS(B.geom, F.geom) = true
      AND ST_INTERSECTS(B.geom, G.geom) = true
      AND ST_INTERSECTS(C.geom, D.geom) = true
      AND ST_INTERSECTS(C.geom, E.geom) = true
      AND ST_INTERSECTS(C.geom, F.geom) = true
      AND ST_INTERSECTS(C.geom, G.geom) = true
      AND ST_INTERSECTS(D.geom, E.geom) = true
      AND ST_INTERSECTS(D.geom, F.geom) = true
      AND ST_INTERSECTS(D.geom, G.geom) = true
      AND ST_INTERSECTS(E.geom, F.geom) = true
      AND ST_INTERSECTS(E.geom, G.geom) = true
      AND ST_INTERSECTS(F.geom, G.geom) = true
      LIMIT 1000;






      postgis intersection





      share







      New contributor




      andryo is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.










      share







      New contributor




      andryo is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.








      share



      share






      New contributor




      andryo is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.









      asked 1 min ago









      andryoandryo

      1




      1




      New contributor




      andryo is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.





      New contributor





      andryo is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.






      andryo is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.






















          0






          active

          oldest

          votes











          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
          });


          }
          });






          andryo is a new contributor. Be nice, and check out our Code of Conduct.










          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fgis.stackexchange.com%2fquestions%2f315436%2fusing-st-intersection-with-three-or-more-tables%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          0






          active

          oldest

          votes








          0






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes








          andryo is a new contributor. Be nice, and check out our Code of Conduct.










          draft saved

          draft discarded


















          andryo is a new contributor. Be nice, and check out our Code of Conduct.













          andryo is a new contributor. Be nice, and check out our Code of Conduct.












          andryo is a new contributor. Be nice, and check out our Code of Conduct.
















          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%2f315436%2fusing-st-intersection-with-three-or-more-tables%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 Классификация | Примечания | Ссылки |...

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

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