[PostGIS] #5836: Different result with same table and same query in various PostGIS versions

PostGIS trac at osgeo.org
Tue Jan 14 08:14:40 PST 2025


#5836: Different result with same table and same query in various PostGIS versions
-------------------------+---------------------
  Reporter:  zhangyijun  |      Owner:  pramsey
      Type:  defect      |     Status:  new
  Priority:  medium      |  Milestone:
 Component:  postgis     |    Version:  3.5.x
Resolution:              |   Keywords:
-------------------------+---------------------
Comment (by robe):

 Wrapping your example in a function:


 {{{
 CREATE OR REPLACE FUNCTION test_mvt(param_1 integer, param_2 integer,
 param_3 integer) RETURNS bytea
 AS $$SELECT
       ST_AsMVT(tile, 'table_source', 4096, 'geom')
     FROM (
       SELECT
         ST_AsMVTGeom(
             ST_Transform(ST_CurveToLine("geom"::geometry), 3857),
             ST_TileEnvelope($1::integer, $2::integer, $3::integer),
             4096, 64, true
         ) AS geom
         , "gid"
       FROM
         "public"."table_source"
       WHERE
         "geom" && ST_Transform(ST_TileEnvelope($1::integer, $2::integer,
 $3::integer, margin => 0.015625), 4326)

     ) AS tile$$ language sql;

 }}}

 and then running these tests


 {{{
 SELECT length(test_mvt(1,1,1));
 SELECT length(test_mvt(1,1,0));
 }}}

 On my: SELECT postgis_full_version() || ' ' || version();

 {{{
 POSTGIS="3.6.0dev 3.5.0-186-gff6fc3b6c" [EXTENSION] PGSQL="170"
 GEOS="3.13.0-CAPI-1.19.0" PROJ="8.2.1 NETWORK_ENABLED=OFF
 URL_ENDPOINT=https://cdn.proj.org
 USER_WRITABLE_DIRECTORY=C:\Users\lr\AppData\Local/proj
 DATABASE_PATH=C:\ming64gcc81\projects\proj\rel-
 proj-8.2.1w64gcc81/share/proj/proj.db" (compiled against PROJ 8.2.1)
 LIBXML="2.12.5" LIBJSON="0.12" LIBPROTOBUF="1.2.1" WAGYU="0.5.0
 (Internal)" PostgreSQL 17.2 on x86_64-w64-mingw32, compiled by gcc.exe
 (x86_64-posix-seh-rev0, Built by MinGW-W64 project) 8.1.0, 64-bit
 }}}


 Yields the same answers as you have for your 3.5

 {{{
 607
 1204/1024 = 1.175 kb
 }}}


 Still need to check the older versions.  I don't remember off hand if we
 made changes between PostGIS 3.3 and 3.5 of MVT or curvetoline support.
 But I would presume that would be where changes might arise.  I think the
 WAGYU version might impact things, but I don't think we updated the WAGYU
 between 3.3 and 3.5
-- 
Ticket URL: <https://trac.osgeo.org/postgis/ticket/5836#comment:2>
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