Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ensure PG 16+ generate same result as PG15 and before #1651

Open
nyurik opened this issue Jan 12, 2025 · 2 comments
Open

Ensure PG 16+ generate same result as PG15 and before #1651

nyurik opened this issue Jan 12, 2025 · 2 comments

Comments

@nyurik
Copy link
Member

nyurik commented Jan 12, 2025

It seems there might be some cases when Martin does not generate the same result in PG 16 as in versions before. More importantly, sometimes martin-cp generates a different number of tiles from it too. We must get a very clear understanding of why it differs, and try to make them the same again.

see also #1642 for a great analysis of this issue by @sharkAndshark

@sharkAndshark
Copy link
Collaborator

sharkAndshark commented Jan 13, 2025

Different result with same table and query

Looks like this is an upstream issue. I've post an issue there.

To verify and duplicate this:

  1. Update the PostGIS version (postgis/postgis:14-3.3 or postgis/postgis:14-3.5) in docker-compose.yml file
  2. just start
  3. Run the query with zxy == 1 1 1 or 1 1 0 and watch the results.
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;

I jsut paste the results here in case someone need it:

z x y pg_version source st_asmvt is_empty
1 1 1 postgis/postgis:14-3.3 table_source (BLOB) 2 bytes yes
1 1 0 postgis/postgis:14-3.3 table_source (BLOB) 2 bytes yes
1 1 1 postgis/postgis:14-3.5 table_source (BLOB) 607 bytes no
1 1 0 postgis/postgis:14-3.5 table_source (BLOB) 1.18 KB no

@sharkAndshark
Copy link
Collaborator

Different features order with various PostGIS versions

I think we could pay less attention on this as there is no guarantee the orders should be same without an order by.
Just update the test.sh to ignore the order with ogrmerge of gdal. I've tried and it works well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants