[postgis-tickets] [PostGIS] #5243: ST_Minkowski offset/translation issue or user problem?

PostGIS trac at osgeo.org
Sat Sep 17 11:47:50 PDT 2022


#5243: ST_Minkowski offset/translation issue or user problem?
----------------------+---------------------------
  Reporter:  osgeoap  |      Owner:  pramsey
      Type:  defect   |     Status:  new
  Priority:  medium   |  Milestone:  PostGIS 3.3.2
 Component:  postgis  |    Version:  3.3.x
Resolution:           |   Keywords:
----------------------+---------------------------
Description changed by osgeoap:

Old description:

> Testing the ST_MinkowskiSum is producing an unexepected translated
> position
> {{{
> for the geometry.
>
> oid    |extname
> |extowner|extnamespace|extrelocatable|extversion|extconfig|extc
> -------+--------------+--------+------------+--------------+----------+---------+----
>   13745|plpgsql       |      10|          11|false         |1.0
> |NULL     |NULL
>   79944|postgis       |      10|        2200|false         |3.2.0
> |{80254}  |{"WH
>   80982|mobilitydb    |      10|        2200|false         |1.1.0
> |NULL     |NULL
> 3694605|postgis_sfcgal|      10|        2200|true          |3.2.0
> |NULL     |NULL
>

>
> WITH T(id,trip) as (
>   SELECT                1,setsrid(tgeompoint '[Point(1000
> 1000)@2012-02-01T00:01:01, Point(1020 1010)@2012-02-01T00:01:02,
> Point(1040 1020)@2012-02-01T00:01:03]',3857)
>   union all SELECT      2,setsrid(tgeompoint '[Point(1100
> 1000)@2012-02-01T00:01:05, Point(1120 1010)@2012-02-01T00:01:06,
> Point(1110 1020)@2012-02-01T00:01:08]',3857)
>   union all SELECT      3,setsrid(tgeompoint '[Point(1200
> 1000)@2012-02-01T00:01:10, Point(1140 1010)@2012-02-01T00:01:20,
> Point(1160 1020)@2012-02-01T00:01:40]',3857)
> )
> select
>   ST_AsEWKT(ST_Force2D(t1.trip::geometry)) as wkt_t1geom,
>   ST_AsEWKT(ST_Force2D(t2.trip::geometry)) as wkt_t2geom,
> ST_AsEWKT(ST_MinkowskiSum(ST_Force2D(transform(t1.trip,3857)::geometry),
> ST_Buffer(ST_Force2D(transform(t1.trip,3857)::geometry),10)))
>   --ST_AsEWKT(ST_MinkowskiSum( transform(t1.trip,3857)::geometry,
> transform(t2.trip,3857)::geometry ) as wkt_mink
> FROM T t1, T t2
> where t1.id < t2.id
>

> wkt_t1geom                                         |wkt_t2geom
> |st_asewkt
> |
> ---------------------------------------------------+---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
> SRID=3857;LINESTRING(1000 1000,1040 1020)
> |SRID=3857;LINESTRING(1100 1000,1120 1010,1110
> 1020)|SRID=3857;MULTIPOLYGON(((1990.0251579118735
> 1999.2911097990932,1990.3551193231879
> 1997.358735770496,1991.0557280900007
> 1995.5278640450006,1992.1000602103095
> 1993.8688539962527,1993.4479825863987
> 1992.445460450043,1995.0476953172788 1991.3123836221034,1996|
> SRID=3857;LINESTRING(1000 1000,1040 1020)
> |SRID=3857;LINESTRING(1200 1000,1140 1010,1160
> 1020)|SRID=3857;MULTIPOLYGON(((1990.0251579118735
> 1999.2911097990932,1990.3551193231879
> 1997.358735770496,1991.0557280900007
> 1995.5278640450006,1992.1000602103095
> 1993.8688539962527,1993.4479825863987
> 1992.445460450043,1995.0476953172788 1991.3123836221034,1996|
> SRID=3857;LINESTRING(1100 1000,1120 1010,1110
> 1020)|SRID=3857;LINESTRING(1200 1000,1140 1010,1160
> 1020)|SRID=3857;MULTIPOLYGON(((2190.0251579118735
> 1999.2911097990932,2190.355119323188 1997.358735770496,2191.055728090001
> 1995.5278640450006,2192.1000602103095
> 1993.8688539962527,2193.4479825863987
> 1992.445460450043,2195.0476953172792 1991.3123836221034,2196.8|
> }}}

New description:

 Testing the ST_MinkowskiSum is producing an unexepected translated
 position
 {{{
 for the geometry. Is this expected?

 oid    |extname
 |extowner|extnamespace|extrelocatable|extversion|extconfig|extc
 -------+--------------+--------+------------+--------------+----------+---------+----
   13745|plpgsql       |      10|          11|false         |1.0
 |NULL     |NULL
   79944|postgis       |      10|        2200|false         |3.2.0
 |{80254}  |{"WH
   80982|mobilitydb    |      10|        2200|false         |1.1.0
 |NULL     |NULL
 3694605|postgis_sfcgal|      10|        2200|true          |3.2.0
 |NULL     |NULL



 WITH T(id,trip) as (
   SELECT                1,setsrid(tgeompoint '[Point(1000
 1000)@2012-02-01T00:01:01, Point(1020 1010)@2012-02-01T00:01:02,
 Point(1040 1020)@2012-02-01T00:01:03]',3857)
   union all SELECT      2,setsrid(tgeompoint '[Point(1100
 1000)@2012-02-01T00:01:05, Point(1120 1010)@2012-02-01T00:01:06,
 Point(1110 1020)@2012-02-01T00:01:08]',3857)
   union all SELECT      3,setsrid(tgeompoint '[Point(1200
 1000)@2012-02-01T00:01:10, Point(1140 1010)@2012-02-01T00:01:20,
 Point(1160 1020)@2012-02-01T00:01:40]',3857)
 )
 select
   ST_AsEWKT(ST_Force2D(t1.trip::geometry)) as wkt_t1geom,
   ST_AsEWKT(ST_Force2D(t2.trip::geometry)) as wkt_t2geom,
   ST_AsEWKT(ST_MinkowskiSum(ST_Force2D(transform(t1.trip,3857)::geometry),
 ST_Buffer(ST_Force2D(transform(t1.trip,3857)::geometry),10)))
   --ST_AsEWKT(ST_MinkowskiSum( transform(t1.trip,3857)::geometry,
 transform(t2.trip,3857)::geometry ) as wkt_mink
 FROM T t1, T t2
 where t1.id < t2.id


 wkt_t1geom                                         |wkt_t2geom
 |st_asewkt
 |
 ---------------------------------------------------+---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
 SRID=3857;LINESTRING(1000 1000,1040 1020)
 |SRID=3857;LINESTRING(1100 1000,1120 1010,1110
 1020)|SRID=3857;MULTIPOLYGON(((1990.0251579118735
 1999.2911097990932,1990.3551193231879 1997.358735770496,1991.0557280900007
 1995.5278640450006,1992.1000602103095
 1993.8688539962527,1993.4479825863987 1992.445460450043,1995.0476953172788
 1991.3123836221034,1996|
 SRID=3857;LINESTRING(1000 1000,1040 1020)
 |SRID=3857;LINESTRING(1200 1000,1140 1010,1160
 1020)|SRID=3857;MULTIPOLYGON(((1990.0251579118735
 1999.2911097990932,1990.3551193231879 1997.358735770496,1991.0557280900007
 1995.5278640450006,1992.1000602103095
 1993.8688539962527,1993.4479825863987 1992.445460450043,1995.0476953172788
 1991.3123836221034,1996|
 SRID=3857;LINESTRING(1100 1000,1120 1010,1110
 1020)|SRID=3857;LINESTRING(1200 1000,1140 1010,1160
 1020)|SRID=3857;MULTIPOLYGON(((2190.0251579118735
 1999.2911097990932,2190.355119323188 1997.358735770496,2191.055728090001
 1995.5278640450006,2192.1000602103095
 1993.8688539962527,2193.4479825863987 1992.445460450043,2195.0476953172792
 1991.3123836221034,2196.8|
 }}}

--
-- 
Ticket URL: <https://trac.osgeo.org/postgis/ticket/5243#comment:4>
PostGIS <http://trac.osgeo.org/postgis/>
The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project.


More information about the postgis-tickets mailing list