Skip to content

Commit

Permalink
Remove upstream header
Browse files Browse the repository at this point in the history
  • Loading branch information
zachasme committed Feb 21, 2023
1 parent 110d571 commit ab848fe
Show file tree
Hide file tree
Showing 3 changed files with 61 additions and 214 deletions.
55 changes: 55 additions & 0 deletions h3/sql/updates/h3--4.1.2--unreleased.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
/*
* Copyright 2023 Bytes & Brains
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

-- complain if script is sourced in psql, rather than via CREATE EXTENSION
\echo Use "ALTER EXTENSION h3 UPDATE TO 'unreleased'" to load this file. \quit

-- ---------- ---------- ---------- ---------- ---------- ---------- ----------
-- GiST Operator Class (opclass_gist.c)
-- ---------- ---------- ---------- ---------- ---------- ---------- ----------

CREATE OR REPLACE FUNCTION h3index_gist_consistent(internal, h3index, smallint, oid, internal) RETURNS boolean
AS 'h3' LANGUAGE C STRICT;
CREATE OR REPLACE FUNCTION h3index_gist_union(internal, internal) RETURNS h3index
AS 'h3' LANGUAGE C STRICT;
CREATE OR REPLACE FUNCTION h3index_gist_compress(internal) RETURNS internal
AS 'h3' LANGUAGE C STRICT;
CREATE OR REPLACE FUNCTION h3index_gist_decompress(internal) RETURNS internal
AS 'h3' LANGUAGE C STRICT;
CREATE OR REPLACE FUNCTION h3index_gist_penalty(internal, internal, internal) RETURNS internal
AS 'h3' LANGUAGE C STRICT;
CREATE OR REPLACE FUNCTION h3index_gist_picksplit(internal, internal) RETURNS internal
AS 'h3' LANGUAGE C STRICT;
CREATE OR REPLACE FUNCTION h3index_gist_same(h3index, h3index, internal) RETURNS internal
AS 'h3' LANGUAGE C STRICT;
CREATE OR REPLACE FUNCTION h3index_gist_distance(internal, h3index, smallint, oid, internal) RETURNS float8
AS 'h3' LANGUAGE C STRICT;

CREATE OPERATOR CLASS h3index_ops DEFAULT FOR TYPE h3index USING gist AS
OPERATOR 3 && ,
OPERATOR 6 = ,
OPERATOR 7 @> ,
OPERATOR 8 <@ ,
OPERATOR 15 <-> (h3index, h3index) FOR ORDER BY integer_ops,

FUNCTION 1 h3index_gist_consistent(internal, h3index, smallint, oid, internal),
FUNCTION 2 h3index_gist_union(internal, internal),
-- FUNCTION 3 h3index_gist_compress(internal),
-- FUNCTION 4 h3index_gist_decompress(internal),
FUNCTION 5 h3index_gist_penalty(internal, internal, internal),
FUNCTION 6 h3index_gist_picksplit(internal, internal),
FUNCTION 7 h3index_gist_same(h3index, h3index, internal),
FUNCTION 8 (h3index, h3index) h3index_gist_distance(internal, h3index, smallint, oid, internal);
13 changes: 6 additions & 7 deletions h3/src/opclass_gist.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@

#include <h3api.h> // Main H3 include
#include "extension.h"
#include "upstream/h3Index.h"

#define H3_ROOT_INDEX -1

Expand Down Expand Up @@ -72,13 +71,13 @@ gist_cmp(H3Index a, H3Index b)
}

/* no shared basecell */
if (H3_GET_BASE_CELL(a) != H3_GET_BASE_CELL(b))
if (getBaseCellNumber(a) != getBaseCellNumber(b))
{
return 0;
}

aRes = H3_GET_RESOLUTION(a);
bRes = H3_GET_RESOLUTION(b);
aRes = getResolution(a);
bRes = getResolution(b);

/* ---- */

Expand Down Expand Up @@ -123,13 +122,13 @@ common_ancestor(H3Index a, H3Index b)
}

/* do not even share the basecell */
if (H3_GET_BASE_CELL(a) != H3_GET_BASE_CELL(b))
if (getBaseCellNumber(a) != getBaseCellNumber(b))
{
return H3_ROOT_INDEX;
}

aRes = H3_GET_RESOLUTION(a);
bRes = H3_GET_RESOLUTION(b);
aRes = getResolution(a);
bRes = getResolution(b);
bigRes = (aRes > bRes) ? aRes : bRes;
for (int i = bigRes; i > 0; i--)
/* iterate back basecells */
Expand Down
207 changes: 0 additions & 207 deletions h3/src/upstream/h3Index.h

This file was deleted.

0 comments on commit ab848fe

Please sign in to comment.