39 static GEOSWKBWriter *writer =
NULL;
40 unsigned char *wkb =
NULL;
44 writer = GEOSWKBWriter_create();
48 GEOSWKBWriter_setOutputDimension(writer, 2);
56 wkb = GEOSWKBWriter_write(writer, geom, size);
58 GEOSGeom_destroy(geom);
79 static GEOSWKTWriter *writer =
NULL;
84 writer = GEOSWKTWriter_create();
88 GEOSWKTWriter_setOutputDimension(writer, 2);
96 wkt = GEOSWKTWriter_write(writer, geom);
98 GEOSGeom_destroy(geom);
131 size_t *size,
int *error)
136 static GEOSWKBWriter *writer =
NULL;
137 unsigned char *wkb =
NULL;
138 int destroy_line = 0, destroy_cats = 0;
142 writer = GEOSWKBWriter_create();
146 if (line_p ==
NULL) {
151 if (line_c ==
NULL) {
164 GEOSWKBWriter_setOutputDimension(writer,
Vect_is_3d(Map) ? 3 : 2);
168 if (destroy_cats == 1)
171 if (destroy_line == 1)
178 wkb = GEOSWKBWriter_write(writer, geom, size);
180 GEOSGeom_destroy(geom);
206 int with_z,
size_t *size)
211 static GEOSWKBWriter *writer =
NULL;
212 unsigned char *wkb =
NULL;
216 writer = GEOSWKBWriter_create();
220 GEOSWKBWriter_setOutputDimension(writer, with_z ? 3 : 2);
228 wkb = GEOSWKBWriter_write(writer, geom, size);
230 GEOSGeom_destroy(geom);
259 static GEOSWKTWriter *writer =
NULL;
264 writer = GEOSWKTWriter_create();
268 GEOSWKTWriter_setOutputDimension(writer, with_z ? 3 : 2);
276 wkt = GEOSWKTWriter_write(writer, geom);
278 GEOSGeom_destroy(geom);
void Vect_destroy_line_struct(struct line_pnts *)
Frees all memory associated with a line_pnts structure, including the structure itself.
void Vect_destroy_cats_struct(struct line_cats *)
Frees all memory associated with line_cats structure, including the struct itself.
int Vect_read_line(struct Map_info *, struct line_pnts *, struct line_cats *, int)
Read vector feature (topological level required)
GEOSGeometry * Vect_read_area_geos(struct Map_info *, int)
Read vector area and stores it as GEOSGeometry instance (polygon)
struct line_pnts * Vect_new_line_struct(void)
Creates and initializes a line_pnts structure.
GEOSGeometry * Vect_line_to_geos(const struct line_pnts *, int, int)
Create GEOSGeometry of given type from feature points.
struct line_cats * Vect_new_cats_struct(void)
Creates and initializes line_cats structure.
int Vect_is_3d(struct Map_info *)
Check if vector map is 3D.
unsigned char * Vect_read_line_to_wkb(struct Map_info *Map, struct line_pnts *line_p, struct line_cats *line_c, int line, size_t *size, int *error)
Read a Well Known Binary (WKB) representation of a given feature id.
char * Vect_read_area_to_wkt(struct Map_info *Map, int area)
Read vector area and return it as Well Known Text (WKT) unsigned char array.
char * Vect_line_to_wkt(const struct line_pnts *points, int type, int with_z)
Create a Well Known Text (WKT) representation of given feature type from points.
unsigned char * Vect_line_to_wkb(const struct line_pnts *points, int type, int with_z, size_t *size)
Create a Well Known Binary (WKB) representation of given feature type from points.
unsigned char * Vect_read_area_to_wkb(struct Map_info *Map, int area, size_t *size)
Read vector area and return it as Well Known Binary (WKB) unsigned char array.
Feature geometry info - coordinates.
struct GEOSGeom_t GEOSGeometry