PostGIS  2.1.10dev-r@@SVN_REVISION@@
lwin_wkt.h
Go to the documentation of this file.
1 #include "liblwgeom_internal.h"
2 
3 /*
4 * Coordinate object to hold information about last coordinate temporarily.
5 * We need to know how many dimensions there are at any given time.
6 */
7 typedef struct
8 {
9  uint8_t flags;
10  double x;
11  double y;
12  double z;
13  double m;
14 }
15 POINT;
16 
17 /*
18 * Global that holds the final output geometry for the WKT parser.
19 */
21 extern const char *parser_error_messages[];
22 
23 /*
24 * Prototypes for the lexer
25 */
26 extern void wkt_lexer_init(char *str);
27 extern void wkt_lexer_close(void);
28 
29 
30 /*
31 * Functions called from within the bison parser to construct geometries.
32 */
33 int wkt_lexer_read_srid(char *str);
34 POINT wkt_parser_coord_2(double c1, double c2);
35 POINT wkt_parser_coord_3(double c1, double c2, double c3);
36 POINT wkt_parser_coord_4(double c1, double c2, double c3, double c4);
39 LWGEOM* wkt_parser_point_new(POINTARRAY *pa, char *dimensionality);
40 LWGEOM* wkt_parser_linestring_new(POINTARRAY *pa, char *dimensionality);
41 LWGEOM* wkt_parser_circularstring_new(POINTARRAY *pa, char *dimensionality);
42 LWGEOM* wkt_parser_triangle_new(POINTARRAY *pa, char *dimensionality);
43 LWGEOM* wkt_parser_polygon_new(POINTARRAY *pa, char dimcheck);
44 LWGEOM* wkt_parser_polygon_add_ring(LWGEOM *poly, POINTARRAY *pa, char dimcheck);
45 LWGEOM* wkt_parser_polygon_finalize(LWGEOM *poly, char *dimensionality);
48 LWGEOM* wkt_parser_curvepolygon_finalize(LWGEOM *poly, char *dimensionality);
52 LWGEOM* wkt_parser_collection_finalize(int lwtype, LWGEOM *col, char *dimensionality);
53 void wkt_parser_geometry_new(LWGEOM *geom, int srid);
54 
double x
Definition: lwin_wkt.h:10
LWGEOM * wkt_parser_polygon_finalize(LWGEOM *poly, char *dimensionality)
Definition: lwin_wkt.c:508
LWGEOM * wkt_parser_triangle_new(POINTARRAY *pa, char *dimensionality)
Definition: lwin_wkt.c:397
double m
Definition: lwin_wkt.h:13
LWGEOM * wkt_parser_collection_add_geom(LWGEOM *col, LWGEOM *geom)
Definition: lwin_wkt.c:729
LWGEOM * wkt_parser_point_new(POINTARRAY *pa, char *dimensionality)
Create a new point.
Definition: lwin_wkt.c:293
LWGEOM * wkt_parser_polygon_add_ring(LWGEOM *poly, POINTARRAY *pa, char dimcheck)
Definition: lwin_wkt.c:458
LWGEOM * wkt_parser_curvepolygon_new(LWGEOM *ring)
Definition: lwin_wkt.c:540
int wkt_lexer_read_srid(char *str)
Read the SRID number from an SRID=<> string.
Definition: lwin_wkt.c:47
LWGEOM * wkt_parser_circularstring_new(POINTARRAY *pa, char *dimensionality)
Create a new circularstring.
Definition: lwin_wkt.c:361
LWGEOM * wkt_parser_collection_new(LWGEOM *geom)
Definition: lwin_wkt.c:671
LWGEOM_PARSER_RESULT global_parser_result
double y
Definition: lwin_wkt.h:11
LWGEOM * wkt_parser_collection_finalize(int lwtype, LWGEOM *col, char *dimensionality)
Definition: lwin_wkt.c:752
LWGEOM * wkt_parser_linestring_new(POINTARRAY *pa, char *dimensionality)
Create a new linestring.
Definition: lwin_wkt.c:327
void wkt_lexer_init(char *str)
Definition: lwin_wkt_lex.c:636
LWGEOM * wkt_parser_curvepolygon_finalize(LWGEOM *poly, char *dimensionality)
Definition: lwin_wkt.c:639
POINTARRAY * wkt_parser_ptarray_new(POINT p)
Start a point array from the first coordinate.
Definition: lwin_wkt.c:276
POINTARRAY * wkt_parser_ptarray_add_coord(POINTARRAY *pa, POINT p)
Definition: lwin_wkt.c:238
Parser result structure: returns the result of attempting to convert (E)WKT/(E)WKB to LWGEOM...
Definition: liblwgeom.h:1713
double z
Definition: lwin_wkt.h:12
void wkt_lexer_close(void)
Definition: lwin_wkt_lex.c:644
Definition: lwin_wkt.h:7
POINT wkt_parser_coord_2(double c1, double c2)
Build a 2d coordinate.
Definition: lwin_wkt.c:194
LWGEOM * wkt_parser_compound_add_geom(LWGEOM *col, LWGEOM *geom)
Definition: lwin_wkt.c:697
LWGEOM * wkt_parser_polygon_new(POINTARRAY *pa, char dimcheck)
Definition: lwin_wkt.c:433
const char * parser_error_messages[]
Definition: lwin_wkt.c:23
POINT wkt_parser_coord_3(double c1, double c2, double c3)
Note, if this is an XYM coordinate we'll have to fix it later when we build the object itself and hav...
Definition: lwin_wkt.c:210
void wkt_parser_geometry_new(LWGEOM *geom, int srid)
Definition: lwin_wkt.c:799
LWGEOM * wkt_parser_curvepolygon_add_ring(LWGEOM *poly, LWGEOM *ring)
Definition: lwin_wkt.c:558
uint8_t flags
Definition: lwin_wkt.h:9
POINT wkt_parser_coord_4(double c1, double c2, double c3, double c4)
Definition: lwin_wkt.c:225