PostGIS  3.4.0dev-r@@SVN_REVISION@@
lwgeom_generate_grid.c File Reference
#include "postgres.h"
#include "fmgr.h"
#include "funcapi.h"
#include "access/htup_details.h"
#include "../postgis_config.h"
#include "lwgeom_pg.h"
#include "liblwgeom.h"
#include <math.h>
#include <float.h>
#include <string.h>
#include <stdio.h>
Include dependency graph for lwgeom_generate_grid.c:

Go to the source code of this file.

Data Structures

struct  GeometryGridState
 
struct  HexagonGridState
 
struct  SquareGridState
 

Macros

#define H   0.8660254037844387
 

Typedefs

typedef struct GeometryGridState GeometryGridState
 
typedef struct HexagonGridState HexagonGridState
 
typedef struct SquareGridState SquareGridState
 

Enumerations

enum  GeometryShape { SHAPE_SQUARE , SHAPE_HEXAGON , SHAPE_TRIANGLE }
 

Functions

Datum ST_Hexagon (PG_FUNCTION_ARGS)
 
Datum ST_Square (PG_FUNCTION_ARGS)
 
Datum ST_ShapeGrid (PG_FUNCTION_ARGS)
 
static LWGEOMhexagon (double origin_x, double origin_y, double size, int cell_i, int cell_j, int32_t srid)
 
static HexagonGridStatehexagon_grid_state (double size, const GBOX *gbox, int32_t srid)
 
static void hexagon_state_next (HexagonGridState *state)
 
static LWGEOMsquare (double origin_x, double origin_y, double size, int cell_i, int cell_j, int32_t srid)
 
static SquareGridStatesquare_grid_state (double size, const GBOX *gbox, int32_t srid)
 
static void square_state_next (SquareGridState *state)
 
 PG_FUNCTION_INFO_V1 (ST_ShapeGrid)
 ST_HexagonGrid(size float8, bounds geometry) ST_SquareGrid(size float8, bounds geometry) More...
 
 PG_FUNCTION_INFO_V1 (ST_Hexagon)
 ST_Hexagon(size double, cell_i integer default 0, cell_j integer default 0, origin geometry default 'POINT(0 0)') More...
 
 PG_FUNCTION_INFO_V1 (ST_Square)
 ST_Square(size double, cell_i integer, cell_j integer, origin geometry default 'POINT(0 0)') More...
 

Variables

static const double hex_x [] = {-1.0, -0.5, 0.5, 1.0, 0.5, -0.5, -1.0}
 
static const double hex_y [] = {0.0, -0.5, -0.5, 0.0, 0.5, 0.5, 0.0}