[postgis-users] overlaps and intersections strange behavior

franco base frenk.calza at gmail.com
Tue May 29 03:49:20 PDT 2018


Thanks I undesrtand.
Infact

SELECT st_contains(b,a)  return true.


I still don't understand why

SELECT  st_intersection(a,b) return a line
and
SELECT st_intersection(a,c) return a point
and
SELECT st_intersection(b,c) return a point



SELECT ST_AsText (c)

return

"LINESTRING(*9.18334214253396 45.4443310195606,9.18284350788197
45.4441804010334,9.18274220788201 45.4441483010334,9.18274220788201
45.4441483010334,9.18271080788202 45.4441388010335,9.18271080788202
45.4441388010335*,9.18267210788205 45.4442348010335,9.18267210788205
45.4442348010335,9.18256900788209 45.4442025010335,9.18256930788208
45.4442020010335,9.1817161078824 45.4439402010335,9.1817161078824
45.4439402010335,9.18096850788267 45.4437069010336,9.18096850788267
45.4437069010336,9.18075270788275 45.4436465010336,9.18075270788275
45.4436465010336,9.18046820788286 45.4435903010337,9.18046820788286
45.4435903010337,9.18017890788296 45.4435440010337,9.18017890788296
45.4435440010337,9.17996920788304 45.4435166010337,9.17996920788304
45.4435166010337,9.17973530788314 45.4435053010337,9.17973530788314
45.4435053010337,9.17950020788323 45.4435044010337,9.17950020788323
45.4435044010337,9.17913950788338 45.4435149010338,9.17913950788338
45.4435149010338,9.17903360788343 45.4435180010338,9.17903360788343
45.4435180010338,9.17900690788344 45.4435188010338,9.17900690788344
45.4435188010338,9.17898210788345 45.4435200010338,9.17898210788345
45.4435200010338,9.17890050788348 45.4435241010338,9.17890050788348
45.4435241010338,9.17876780788353 45.4435307010338,9.17847140788366
45.4435455010338,9.17875697558416 45.4435312419178)"

The first 6 point are the same that make b geometry

>> st_makepoint(9.18334214253396,45.4443310195606),
>> st_makepoint(9.18284350788197,45.4441804010334),
>> st_makepoint(9.18274220788201,45.4441483010334),
>> st_makepoint(9.18274220788201,45.4441483010334),
>> st_makepoint(9.18271080788202,45.4441388010335),
>> st_makepoint(9.18271080788202,45.4441388010335)

The first 2 point are the same that make a geometry
>> st_makepoint(9.18284350788197,45.4441804010334),
>> st_makepoint(9.18334214253396,45.4443310195606)



thanks
f






2018-05-28 21:22 GMT+02:00 Paul Ramsey <pramsey at cleverelephant.ca>:

> Also knowing that the end points of a line string are considered the
> boundary of the linestring, not the interior...
>
> On Mon, May 28, 2018 at 12:21 PM, Paul Ramsey <pramsey at cleverelephant.ca>
> wrote:
> > Does knowing that an overlaps test is only true if the interiors of
> > both objects interact, but there is no full containment relationship
> > help you understand a little?
> >
> > On Mon, May 28, 2018 at 8:03 AM, franco base <frenk.calza at gmail.com>
> wrote:
> >> Hi all,
> >>
> >>
> >> question 1)
> >> why ST_Overlaps doesn't work with geometry a and b?
> >> The first 2 point of the 2 line (bold) are the same.
> >> ST_Intersection works
> >>
> >> question 2)
> >> if I extend line b it becomes c
> >> (sorry i write text geometry because I have a lot of point coord),
> >> ST_Overlaps return false and also
> >> ST_Intersection return a point (length =0)
> >>
> >> What's happen?
> >>
> >> "POSTGIS="2.2.1 r14555" GEOS="3.5.0-CAPI-1.9.0 r4084" PROJ="Rel. 4.9.2,
> 08
> >> September 2015" GDAL="GDAL 1.11.3, released 2015/09/16" LIBXML="2.9.3"
> >> LIBJSON="0.11.99" TOPOLOGY RASTER"
> >>
> >>
> >> WITH geom AS
> >> (
> >> SELECT
> >> st_setsrid(st_makeline(
> >> st_makepoint(9.18284350788197,45.4441804010334),
> >> st_makepoint(9.18334214253396,45.4443310195606)
> >> ),4326) a,
> >>
> >> st_setsrid(st_makeline(ARRAY[
> >> st_makepoint(9.18334214253396,45.4443310195606),
> >> st_makepoint(9.18284350788197,45.4441804010334),
> >> st_makepoint(9.18274220788201,45.4441483010334),
> >> st_makepoint(9.18274220788201,45.4441483010334),
> >> st_makepoint(9.18271080788202,45.4441388010335),
> >> st_makepoint(9.18271080788202,45.4441388010335) ]),4326) b,
> >>
> >> '0102000020E610000027000000E8527405DF5D224039CEBED6DFB846402A
> 470DAA9D5D22403CFB43E7DAB8464073E7FC62905D22409DC1FDD9D9B846
> 4073E7FC62905D22409DC1FDD9D9B8464040F560458C5D224065A94C8AD9
> B8464040F560458C5D224065A94C8AD9B84640577DD232875D224085179B
> AFDCB84640577DD232875D224085179BAFDCB84640C43B5CAF795D2240BB
> 5EA7A0DBB84640BB366DB9795D2240D5A0759CDBB84640CB05C9E4095D22
> 40CC685208D3B84640CB05C9E4095D2240CC685208D3B8464088EC7DE7A7
> 5C224074794263CBB8464088EC7DE7A75C224074794263CBB84640280A72
> 9E8B5C224050769668C9B84640280A729E8B5C224050769668C9B8464031
> A63554665C224097E12591C7B8464031A63554665C224097E12591C7B846
> 409A92E968405C22406A63C10CC6B846409A92E968405C22406A63C10CC6
> B84640164A8CEC245C22402356E826C5B84640164A8CEC245C22402356E8
> 26C5B84640D4962A44065C22406FC51DC8C4B84640D4962A44065C22406F
> C51DC8C4B84640A5F78473E75B2240380991C0C4B84640A5F78473E75B22
> 40380991C0C4B84640B08F6F2CB85B2240449DA518C5B84640B08F6F2CB8
> 5B2240449DA518C5B84640087D054BAA5B224050D0A632C5B84640087D05
> 4BAA5B224050D0A632C5B84640213C1ECBA65B2240F2CC5C39C5B8464021
> 3C1ECBA65B2240F2CC5C39C5B846406BDBF78AA35B2240F0C76D43C5B846
> 406BDBF78AA35B2240F0C76D43C5B84640D731EDD8985B2240C676D265C5
> B84640D731EDD8985B2240C676D265C5B84640EFDF4074875B224027DB2F
> 9DC5B846404443B89A605B2240369D5619C6B84640B521C808865B224047
> 65B9A1C5B84640'::geometry
> >> as c
> >> )
> >>
> >>
> >> SELECT
> >> ---- question 1
> >> st_overlaps(a,b),
> >> st_length(st_intersection(a,b)::geography)::int,
> >> ---- question 2
> >> st_overlaps(a,c),
> >> st_length(st_intersection(a,c)::geography)::int
> >>
> >> FROM geom
> >>
> >>
> >> return
> >>
> >> f;42;f;0
> >>
> >>
> >>
> >> thanks
> >> ft
> >>
> >>
> >>
> >>
> >>
> >>
> >>
> >> _______________________________________________
> >> postgis-users mailing list
> >> postgis-users at lists.osgeo.org
> >> https://lists.osgeo.org/mailman/listinfo/postgis-users
> _______________________________________________
> postgis-users mailing list
> postgis-users at lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/postgis-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20180529/742d17fa/attachment.html>


More information about the postgis-users mailing list