37 static GEOSWKBWriter *writer =
NULL;
38 unsigned char *wkb =
NULL;
42 writer = GEOSWKBWriter_create();
46 GEOSWKBWriter_setOutputDimension(writer, 2);
54 wkb = GEOSWKBWriter_write(writer, geom, size);
56 GEOSGeom_destroy(geom);
76 static GEOSWKTWriter *writer =
NULL;
81 writer = GEOSWKTWriter_create();
85 GEOSWKTWriter_setOutputDimension(writer, 2);
93 wkt = GEOSWKTWriter_write(writer, geom);
95 GEOSGeom_destroy(geom);
128 int line,
size_t *size,
133 static GEOSWKBWriter *writer =
NULL;
134 unsigned char *wkb =
NULL;
135 int destroy_line = 0, destroy_cats = 0;
139 writer = GEOSWKBWriter_create();
160 GEOSWKBWriter_setOutputDimension(writer,
Vect_is_3d(Map) ? 3 : 2);
164 if(destroy_cats == 1)
167 if(destroy_line == 1)
174 wkb = GEOSWKBWriter_write(writer, geom, size);
176 GEOSGeom_destroy(geom);
202 int type,
int with_z,
size_t *size)
206 static GEOSWKBWriter *writer =
NULL;
207 unsigned char *wkb =
NULL;
211 writer = GEOSWKBWriter_create();
215 GEOSWKBWriter_setOutputDimension(writer, with_z ? 3 : 2);
223 wkb = GEOSWKBWriter_write(writer, geom, size);
225 GEOSGeom_destroy(geom);
250 int type,
int with_z)
254 static GEOSWKTWriter *writer =
NULL;
259 writer = GEOSWKTWriter_create();
263 GEOSWKTWriter_setOutputDimension(writer, with_z ? 3 : 2);
271 wkt = GEOSWKTWriter_write(writer, geom);
273 GEOSGeom_destroy(geom);
unsigned char * Vect_read_line_to_wkb(const 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.
GEOSGeometry * Vect_read_area_geos(struct Map_info *, int)
Read vector area and stores it as GEOSGeometry instance (polygon)
Feature geometry info - coordinates.
struct line_pnts * Vect_new_line_struct(void)
Creates and initializes a line_pnts structure.
void Vect_destroy_cats_struct(struct line_cats *)
Frees all memory associated with line_cats structure, including the struct itself.
GEOSGeometry * Vect_line_to_geos(const struct line_pnts *, int, int)
Create GEOSGeometry of given type from feature points.
struct GEOSGeom_t GEOSGeometry
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.
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.
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.
int Vect_is_3d(const struct Map_info *)
Check if vector map is 3D.
struct line_cats * Vect_new_cats_struct(void)
Creates and initializes line_cats structure.
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.
void Vect_destroy_line_struct(struct line_pnts *)
Frees all memory associated with a line_pnts structure, including the structure itself.
int Vect_read_line(const struct Map_info *, struct line_pnts *, struct line_cats *, int)
Read vector feature (topological level required)
plus_t area
Area it exists w/in, if any.