PostGIS  2.5.0dev-r@@SVN_REVISION@@
mvt.h
Go to the documentation of this file.
1 /**********************************************************************
2  *
3  * PostGIS - Spatial Types for PostgreSQL
4  * http://postgis.net
5  *
6  * PostGIS is free software: you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation, either version 2 of the License, or
9  * (at your option) any later version.
10  *
11  * PostGIS is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with PostGIS. If not, see <http://www.gnu.org/licenses/>.
18  *
19  **********************************************************************
20  *
21  * Copyright (C) 2016-2017 Bj√∂rn Harrtell <bjorn@wololo.org>
22  *
23  **********************************************************************/
24 
25 #ifndef MVT_H_
26 #define MVT_H_ 1
27 
28 #include <stdlib.h>
29 #include "postgres.h"
30 #include "utils/builtins.h"
31 #include "utils/array.h"
32 #include "utils/typcache.h"
33 #include "utils/lsyscache.h"
34 #include "catalog/pg_type.h"
35 #include "catalog/namespace.h"
36 #include "executor/executor.h"
37 #include "access/htup_details.h"
38 #include "access/htup.h"
39 #include "../postgis_config.h"
40 #include "liblwgeom.h"
41 #include "liblwgeom_internal.h"
42 #include "lwgeom_pg.h"
43 #include "lwgeom_log.h"
44 
45 #ifdef HAVE_LIBPROTOBUF
46 
47 #include "vector_tile.pb-c.h"
48 
49 typedef struct mvt_agg_context {
50  char *name;
52  char *geom_name;
54  HeapTupleHeader row;
55  VectorTile__Tile__Feature *feature;
56  VectorTile__Tile__Layer *layer;
57  VectorTile__Tile *tile;
70 
71 /* Prototypes */
72 LWGEOM *mvt_geom(LWGEOM *geom, const GBOX *bounds, uint32_t extent, uint32_t buffer, bool clip_geom);
75 bytea *mvt_agg_finalfn(mvt_agg_context *ctx);
77 mvt_agg_context * mvt_ctx_deserialize(const bytea *ba);
79 
80 
81 #endif /* HAVE_LIBPROTOBUF */
82 
83 #endif
HeapTupleHeader row
Definition: mvt.h:54
uint32_t c
Definition: mvt.h:68
void mvt_agg_transfn(mvt_agg_context *ctx)
Aggregation step.
Definition: mvt.c:827
struct mvt_kv_double_value * double_values_hash
Definition: mvt.h:62
struct mvt_kv_string_value * string_values_hash
Definition: mvt.h:60
char * name
Definition: mvt.h:50
LWGEOM * mvt_geom(LWGEOM *geom, const GBOX *bounds, uint32_t extent, uint32_t buffer, bool clip_geom)
Transform a geometry into vector tile coordinate space.
Definition: mvt.c:682
VectorTile__Tile * tile
Definition: mvt.h:57
char * geom_name
Definition: mvt.h:52
struct mvt_kv_float_value * float_values_hash
Definition: mvt.h:61
struct mvt_agg_context mvt_agg_context
unsigned int uint32_t
Definition: uthash.h:78
VectorTile__Tile__Layer * layer
Definition: mvt.h:56
Datum buffer(PG_FUNCTION_ARGS)
mvt_agg_context * mvt_ctx_combine(mvt_agg_context *ctx1, mvt_agg_context *ctx2)
Definition: mvt.c:1092
uint32_t keys_hash_i
Definition: mvt.h:67
size_t features_capacity
Definition: mvt.h:58
Definition: mvt.c:54
struct mvt_kv_uint_value * uint_values_hash
Definition: mvt.h:63
uint32_t geom_index
Definition: mvt.h:53
struct mvt_kv_bool_value * bool_values_hash
Definition: mvt.h:65
uint32_t values_hash_i
Definition: mvt.h:66
uint32_t extent
Definition: mvt.h:51
VectorTile__Tile__Feature * feature
Definition: mvt.h:55
struct mvt_kv_key * keys_hash
Definition: mvt.h:59
bytea * mvt_ctx_serialize(mvt_agg_context *ctx)
Definition: mvt.c:919
struct mvt_kv_sint_value * sint_values_hash
Definition: mvt.h:64
void mvt_agg_init_context(mvt_agg_context *ctx)
Initialize aggregation context.
Definition: mvt.c:787
mvt_agg_context * mvt_ctx_deserialize(const bytea *ba)
Definition: mvt.c:934
bytea * mvt_agg_finalfn(mvt_agg_context *ctx)
Finalize aggregation.
Definition: mvt.c:1125
This library is the generic geometry handling section of PostGIS.