Skip to content

Commit

Permalink
export: remove precision conversion from tile calculation (cont.) (#1398
Browse files Browse the repository at this point in the history
)

Signed-off-by: qGYdXbY2 <[email protected]>
  • Loading branch information
qGYdXbY2 authored Nov 11, 2024
1 parent 7e98d8b commit bc7c552
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public class DatabaseMaintainer {
private static final Logger logger = LogManager.getLogger();

/** Is used to check against xyz_ext_version() */
public static final int XYZ_EXT_VERSION = 204;
public static final int XYZ_EXT_VERSION = 205;

public static final int H3_CORE_VERSION = 108;

Expand Down
16 changes: 8 additions & 8 deletions xyz-psql-connector/src/main/resources/xyz_ext.sql
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@
CREATE OR REPLACE FUNCTION xyz_ext_version()
RETURNS integer AS
$BODY$
select 204
select 205
$BODY$
LANGUAGE sql IMMUTABLE;

Expand Down Expand Up @@ -3969,7 +3969,7 @@ begin
with
indata as ( select exp_build_sql_inhabited_txt.iqk as iqk,
exp_build_sql_inhabited_txt.mlevel as mlevel,
exp_build_sql_inhabited_txt.sql_with_jsondata_geo as sql_export_data,
_strip_conversion(exp_build_sql_inhabited_txt.sql_with_jsondata_geo) as sql_export_data,
_strip_conversion(coalesce( exp_build_sql_inhabited_txt.sql_qk_tileqry_with_geo, exp_build_sql_inhabited_txt.sql_with_jsondata_geo)) as sql_qks,
exp_build_sql_inhabited_txt.max_tiles as max_tiles
),
Expand All @@ -3987,7 +3987,7 @@ begin
with
indata as ( select exp_build_sql_inhabited_txt.iqk as iqk,
exp_build_sql_inhabited_txt.mlevel as mlevel,
exp_build_sql_inhabited_txt.sql_with_jsondata_geo as sql_export_data,
_strip_conversion(exp_build_sql_inhabited_txt.sql_with_jsondata_geo) as sql_export_data,
_strip_conversion(coalesce( exp_build_sql_inhabited_txt.sql_qk_tileqry_with_geo, exp_build_sql_inhabited_txt.sql_with_jsondata_geo)) as sql_qks,
exp_build_sql_inhabited_txt.max_tiles as max_tiles
),
Expand Down Expand Up @@ -4031,7 +4031,7 @@ begin
with
indata as ( select exp2_build_sql_inhabited_txt.iqk as iqk,
exp2_build_sql_inhabited_txt.mlevel as mlevel,
exp2_build_sql_inhabited_txt.sql_with_jsondata_geo as sql_export_data,
_strip_conversion(exp2_build_sql_inhabited_txt.sql_with_jsondata_geo) as sql_export_data,
_strip_conversion(coalesce( exp2_build_sql_inhabited_txt.sql_qk_tileqry_with_geo, exp2_build_sql_inhabited_txt.sql_with_jsondata_geo)) as sql_qks,
exp2_build_sql_inhabited_txt.max_tiles as max_tiles
),
Expand All @@ -4049,7 +4049,7 @@ begin
with
indata as ( select exp2_build_sql_inhabited_txt.iqk as iqk,
exp2_build_sql_inhabited_txt.mlevel as mlevel,
exp2_build_sql_inhabited_txt.sql_with_jsondata_geo as sql_export_data,
_strip_conversion(exp2_build_sql_inhabited_txt.sql_with_jsondata_geo) as sql_export_data,
_strip_conversion(coalesce( exp2_build_sql_inhabited_txt.sql_qk_tileqry_with_geo, exp2_build_sql_inhabited_txt.sql_with_jsondata_geo)) as sql_qks,
exp2_build_sql_inhabited_txt.max_tiles as max_tiles
),
Expand All @@ -4059,7 +4059,7 @@ begin
group by rr.bucket, rr.tiles_total
)
select r.iqk as qk, r.mlevel, r.sql_export_data, r.max_tiles, l.*,
format('select htiles_convert_qk_to_longk(tile_id)::text as tile_id, jsondata, geo from qk_s_get_featurelist_of_tiles_txt(true,%1$L::text[],%2$L,%3$s,%4$s)',l.tlist,r.sql_export_data,v_clipped,v_includeEmpty) as s3sql
format('select htiles_convert_qk_to_longk(tile_id)::text as tile_id, jsondata, st_geomfromtext(st_astext(geo,8),4326) as geo from qk_s_get_featurelist_of_tiles_txt(true,%1$L::text[],%2$L,%3$s,%4$s)',l.tlist,r.sql_export_data,v_clipped,v_includeEmpty) as s3sql
from ibuckets l, indata r
order by bucket;
end if;
Expand Down Expand Up @@ -4159,7 +4159,7 @@ declare
cnt bigint;
begin
if esitmated_count IS null then
execute format('select count(1) from (%1$s) q1', sql_with_jsondata_geo ) into cnt;
execute format('select count(1) from (%1$s) q1', _strip_conversion(sql_with_jsondata_geo) ) into cnt;
else
cnt := esitmated_count;
end if;
Expand Down Expand Up @@ -4245,7 +4245,7 @@ begin
end if;
return query select coalesce( ARRAY_AGG(qk), ARRAY[''] ) from (
select qk from exp_qk_weight(htile, iqk, mlevel, _weight, tbllist, sql_with_jsondata_geo
select qk from exp_qk_weight(htile, iqk, mlevel, _weight, tbllist, _strip_conversion(sql_with_jsondata_geo)
) order by weight DESC) a;
end
$BODY$;
Expand Down

0 comments on commit bc7c552

Please sign in to comment.