How to find the closest polygons to a pointIdentifying topological relationships using PostGISAdding height...

What's the oldest plausible frozen specimen for a Jurassic Park style story-line?

Equivalent of "illegal" for violating civil law

Why did Luke use his left hand to shoot?

What makes papers publishable in top-tier journals?

How big is a framed opening for a door relative to the finished door opening width?

"Starve to death" Vs. "Starve to the point of death"

Charging phone battery with a lower voltage, coming from a bike charger?

Does diversity provide anything that meritocracy does not?

Allow console draw poker game to output more hands

How to completely remove a package in Ubuntu (like it never existed)

Prevent Nautilus / Nemo from creating .Trash-1000 folder in mounted devices

How do I avoid the "chosen hero" feeling?

What can I do to encourage my players to use their consumables?

Boss asked me to sign a resignation paper without a date on it along with my new contract

Critique vs nitpicking

How to not let the Identify spell spoil everything?

How do you funnel food off a cutting board?

Eww, those bytes are gross

Sharepoint metadata URL

Concatenating two int[]

Potential client has a problematic employee I can't work with

Why do neural networks need so many examples to perform?

Is there a verb that means to inject with poison?

What kind of places would goblins live in a fantasy setting with strong states?



How to find the closest polygons to a point


Identifying topological relationships using PostGISAdding height from nearest XYZ point to geom table in PostGIS?How to find the buildings (polygons) a user can see from a given location (point) and orientation (angle range)?Combined Hstore key/value and spatial query too slow to handle bigger OSM extractsPostGIS nearest point with ST_DistancePostGIS nearest point with LATERAL JOIN in PostgreSQL 9.3+Interpolating point to nearest polygons to compute street width in posgisVarying result of ST_ClosestPoint() depending on ST_DWithin() distance parameterProgrammatically move points in front of building polygons in PostGISFind closest point on a MulitLineString for each point of a MultiPoint













0















I am trying to the find the four closest building polygons to a junction point layer. I understand how to obtain this for a single point but am unsure of how to specify the four closest polygons for every point in my layer.



CODE:



drop table if exists corner_buildings;
create table corner_buildings as
select buildings.geom as buildgeom, nodes.geom as nodegeom
from buildings, nodes
where nodes.objectid=1 AND st_Dwithin(buildings.geom, nodes.geom, 200)
order by st_distance(buildings.geom, nodes.geom) Limit 4;









share





























    0















    I am trying to the find the four closest building polygons to a junction point layer. I understand how to obtain this for a single point but am unsure of how to specify the four closest polygons for every point in my layer.



    CODE:



    drop table if exists corner_buildings;
    create table corner_buildings as
    select buildings.geom as buildgeom, nodes.geom as nodegeom
    from buildings, nodes
    where nodes.objectid=1 AND st_Dwithin(buildings.geom, nodes.geom, 200)
    order by st_distance(buildings.geom, nodes.geom) Limit 4;









    share



























      0












      0








      0








      I am trying to the find the four closest building polygons to a junction point layer. I understand how to obtain this for a single point but am unsure of how to specify the four closest polygons for every point in my layer.



      CODE:



      drop table if exists corner_buildings;
      create table corner_buildings as
      select buildings.geom as buildgeom, nodes.geom as nodegeom
      from buildings, nodes
      where nodes.objectid=1 AND st_Dwithin(buildings.geom, nodes.geom, 200)
      order by st_distance(buildings.geom, nodes.geom) Limit 4;









      share
















      I am trying to the find the four closest building polygons to a junction point layer. I understand how to obtain this for a single point but am unsure of how to specify the four closest polygons for every point in my layer.



      CODE:



      drop table if exists corner_buildings;
      create table corner_buildings as
      select buildings.geom as buildgeom, nodes.geom as nodegeom
      from buildings, nodes
      where nodes.objectid=1 AND st_Dwithin(buildings.geom, nodes.geom, 200)
      order by st_distance(buildings.geom, nodes.geom) Limit 4;







      postgis postgresql sql





      share














      share












      share



      share








      edited 3 mins ago







      Daykray

















      asked 9 mins ago









      DaykrayDaykray

      846




      846






















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


          }
          });














          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fgis.stackexchange.com%2fquestions%2f313511%2fhow-to-find-the-closest-polygons-to-a-point%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
















          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%2f313511%2fhow-to-find-the-closest-polygons-to-a-point%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

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

          Венесуэла на летних Олимпийских играх 2000 Содержание Состав...

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