[prev in list] [next in list] [prev in thread] [next in thread] 

List:       postgis-users
Subject:    [postgis-users] Fwd:  problem with points in polygon edge
From:       Gustavo Martinez <gmpuljak () yahoo ! com ! ar>
Date:       2022-03-17 11:54:22
Message-ID: fc490a13-2783-021b-3bad-1a2d997014f4 () yahoo ! com ! ar
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


-------- Mensaje reenviado --------
Asunto: 	Re: [postgis-users] problem with points in polygon edge
Fecha: 	Wed, 16 Mar 2022 15:21:31 -0300
De: 	Gustavo Martinez <gmpuljak@yahoo.com.ar>
A: 	Greg Troxel <gdt@lexort.com>



Hi Greg,

I can't share the database. Attached are 2 shapefiles with the data of 
the following example (consider that the queries run on the server):

- select b.grado, b.cuarto, count(idvms) from monitoreo.vms_2021 a, 
datos.cuadricula_05 b where a.idprts='20215019326' and 
st_within(a.geom,b.geom) group by 1,2;

Gives:

grado    cuarto    count
3857    NE    13
3857    NO    49
3857    SO    6
3858    SE    13
3958    NE    16
3958    SO    16
4058    NO    15
4059    NE    3
4059    SE    19
4159    NE    11
4159    NO    6
4159    SO    18
4259    NO    18
4259    SO    10
4260    SE    6
4360    NE    17
4360    SE    14
4459    NO    453
4460    NE    307


- select b.grado, b.cuarto, count(idvms) from monitoreo.vms_2021 a, 
datos.cuadricula_05 b where a.idprts='20215019326' and 
st_intersects(a.geom,b.geom) group by 1,2;

Gives:

grado    cuarto    count
3857    NE    13
3857    NO    49
3857    SO    6
3858    SE    13
3958    NE    16
3958    SO    16
4058    NO    15
4059    NE    3
4059    SE    19
4159    NE    11
4159    NO    6
4159    SO    18
4259    NO    18
4259    SO    10
4260    SE    6
4360    NE    17
4360    SE    14
4459    NO    461
4460    NE    315


- select b.grado, b.cuarto, count(idvms) from monitoreo.vms_2021 a, 
datos.cuadricula_05 b where a.idprts='20215019326' and 
monitoreo.dentro(a.geom,b.geom) group by 1,2;

Gives:

grado    cuarto    count
3958    SO    16
4259    NO    18
4059    NE    3
4159    NO    6
4460    NE    315
3857    NE    13
4159    SO    18
3958    NE    16
3857    SO    6
3857    NO    49
4360    NE    17
4260    SE    6
4259    SO    10
4459    NO    453
4058    NO    15
3858    SE    13
4360    SE    14
4059    SE    19
4159    NE    11


- select count(idvms) from monitoreo.vms_2021 where idprts='20215019326'

Gives:

count
1018

You can see that st_intersects adds points and st_within gives a lower 
count that the real one.


El 16/3/22 a las 14:30, Greg Troxel escribió:

> You still haven't explained what you are trying to do, and haven't
> posted your queries.  That's ok, but I have not further useful
> suggestions for you.
>
-- 

*Gustavo Martínez Puljak*

*
*cel: +549 11 64089000
Linkedin:www.linkedin.com/in/gustavomartinezpuljak 
<https://www.linkedin.com/in/gustavomartinezpuljak>

*
*/Que la tierra se vaya haciendo camino ante tus pasos,//
//que el viento sople siempre a tus espaldas,//
//que el sol brille cálido sobre tu cara,//
//que la lluvia caiga suavemente sobre tus campos y,//
//hasta tanto volvamos a encontrarnos,//
//que Dios te lleve en la palma de su mano./



[Attachment #5 (text/html)]

<html>
  <head>

    <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  </head>
  <body>
    <p><br>
    </p>
    <div class="moz-forward-container"><br>
      <br>
      -------- Mensaje reenviado --------
      <table class="moz-email-headers-table" cellspacing="0"
        cellpadding="0" border="0">
        <tbody>
          <tr>
            <th valign="BASELINE" nowrap="nowrap" align="RIGHT">Asunto:
            </th>
            <td>Re: [postgis-users] problem with points in polygon edge</td>
          </tr>
          <tr>
            <th valign="BASELINE" nowrap="nowrap" align="RIGHT">Fecha: </th>
            <td>Wed, 16 Mar 2022 15:21:31 -0300</td>
          </tr>
          <tr>
            <th valign="BASELINE" nowrap="nowrap" align="RIGHT">De: </th>
            <td>Gustavo Martinez <a class="moz-txt-link-rfc2396E" \
href="mailto:gmpuljak@yahoo.com.ar">&lt;gmpuljak@yahoo.com.ar&gt;</a></td>  </tr>
          <tr>
            <th valign="BASELINE" nowrap="nowrap" align="RIGHT">A: </th>
            <td>Greg Troxel <a class="moz-txt-link-rfc2396E" \
href="mailto:gdt@lexort.com">&lt;gdt@lexort.com&gt;</a></td>  </tr>
        </tbody>
      </table>
      <br>
      <br>
      <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
      <p>Hi Greg,</p>
      <p>I can't share the database. Attached are 2 shapefiles with the
        data of the following example (consider that the queries run on
        the server):</p>
      <p>- select b.grado, b.cuarto, count(idvms) from
        monitoreo.vms_2021 a, datos.cuadricula_05 b where
        a.idprts='20215019326' and st_within(a.geom,b.geom) group by
        1,2;</p>
      <p>Gives:</p>
      <p>grado    cuarto    count<br>
        3857    NE    13<br>
        3857    NO    49<br>
        3857    SO    6<br>
        3858    SE    13<br>
        3958    NE    16<br>
        3958    SO    16<br>
        4058    NO    15<br>
        4059    NE    3<br>
        4059    SE    19<br>
        4159    NE    11<br>
        4159    NO    6<br>
        4159    SO    18<br>
        4259    NO    18<br>
        4259    SO    10<br>
        4260    SE    6<br>
        4360    NE    17<br>
        4360    SE    14<br>
        4459    NO    453<br>
        4460    NE    307</p>
      <p><br>
      </p>
      <p>- select b.grado, b.cuarto, count(idvms) from
        monitoreo.vms_2021 a, datos.cuadricula_05 b where
        a.idprts='20215019326' and st_intersects(a.geom,b.geom) group by
        1,2;</p>
      <p>Gives:</p>
      <p>grado    cuarto    count<br>
        3857    NE    13<br>
        3857    NO    49<br>
        3857    SO    6<br>
        3858    SE    13<br>
        3958    NE    16<br>
        3958    SO    16<br>
        4058    NO    15<br>
        4059    NE    3<br>
        4059    SE    19<br>
        4159    NE    11<br>
        4159    NO    6<br>
        4159    SO    18<br>
        4259    NO    18<br>
        4259    SO    10<br>
        4260    SE    6<br>
        4360    NE    17<br>
        4360    SE    14<br>
        4459    NO    461<br>
        4460    NE    315</p>
      <p><br>
      </p>
      <p>- select b.grado, b.cuarto, count(idvms) from
        monitoreo.vms_2021 a, datos.cuadricula_05 b where
        a.idprts='20215019326' and monitoreo.dentro(a.geom,b.geom) group
        by 1,2;<br>
      </p>
      <p>Gives:</p>
      <p>grado    cuarto    count<br>
        3958    SO    16<br>
        4259    NO    18<br>
        4059    NE    3<br>
        4159    NO    6<br>
        4460    NE    315<br>
        3857    NE    13<br>
        4159    SO    18<br>
        3958    NE    16<br>
        3857    SO    6<br>
        3857    NO    49<br>
        4360    NE    17<br>
        4260    SE    6<br>
        4259    SO    10<br>
        4459    NO    453<br>
        4058    NO    15<br>
        3858    SE    13<br>
        4360    SE    14<br>
        4059    SE    19<br>
        4159    NE    11</p>
      <p><br>
      </p>
      <p>- select count(idvms) from monitoreo.vms_2021 where
        idprts='20215019326'</p>
      <p>Gives:</p>
      <p>count<br>
        1018<br>
      </p>
      <p>You can see that st_intersects adds points and st_within gives
        a lower count that the real one.<br>
      </p>
      <p><br>
      </p>
      <p>El 16/3/22 a las 14:30, Greg Troxel escribió:</p>
      <blockquote type="cite" cite="mid:rmi35jhpzyb.fsf@s1.lexort.com">
        <pre class="moz-quote-pre" wrap="">You still haven't explained what you are \
trying to do, and haven't posted your queries.  That's ok, but I have not further \
useful suggestions for you.

</pre>
      </blockquote>
      <div class="moz-signature">-- <br>
        <p><font face="monospace"><font style="font-size: 14pt" size="4"><b>Gustavo
                Martínez Puljak</b></font></font></p>
        <p style="margin-bottom: 0cm"><font style="font-size: 14pt"
            size="4"><b><br>
            </b></font><font style="font-size: 10pt" size="2">cel: +549
            11 64089000</font><br>
          <font face="monospace"><font style="font-size: 10pt" size="2">Linkedin:<a
                href="https://www.linkedin.com/in/gustavomartinezpuljak"
                moz-do-not-send="true">www.linkedin.com/in/gustavomartinezpuljak</a></font></font></p>
  <p><b><br>
          </b><font face="monospace"><font style="font-size: 10pt"
              size="2"><i>Que la tierra se vaya haciendo camino ante tus
                pasos,</i></font></font><font style="font-size: 10pt"
            size="2"><i><br>
            </i></font><font face="monospace"><font style="font-size:
              10pt" size="2"><i>que el viento sople siempre a tus
                espaldas,</i></font></font><font style="font-size: 10pt"
            size="2"><i><br>
            </i></font><font face="monospace"><font style="font-size:
              10pt" size="2"><i>que el sol brille cálido sobre tu \
cara,</i></font></font><font  style="font-size: 10pt" size="2"><i><br>
            </i></font><font face="monospace"><font style="font-size:
              10pt" size="2"><i>que la lluvia caiga suavemente sobre tus
                campos y,</i></font></font><font style="font-size: 10pt"
            size="2"><i><br>
            </i></font><font face="monospace"><font style="font-size:
              10pt" size="2"><i>hasta tanto volvamos a \
encontrarnos,</i></font></font><font  style="font-size: 10pt" size="2"><i><br>
            </i></font><font face="monospace"><font style="font-size:
              10pt" size="2"><i>que Dios te lleve en la palma de su
                mano.</i></font></font></p>
        <p><br>
          <br>
        </p>
      </div>
    </div>
  </body>
</html>


["example.zip" (application/zip)]

_______________________________________________
postgis-users mailing list
postgis-users@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/postgis-users


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic