GRASS GIS 8 Programmer's Manual
8.5.0dev(2024)-36359e2344
|
Vector library - GEOS powered WKT and WKB export. More...
Go to the source code of this file.
Functions | |
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. More... | |
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. More... | |
char * | Vect_read_area_to_wkt2 (struct Map_info *Map, int area, bool trim) |
Read vector area and return it as Well Known Text (WKT) unsigned char array. More... | |
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. More... | |
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. More... | |
char * | Vect_line_to_wkt (const struct line_pnts *points, int type, bool with_z) |
Create a Well Known Text (WKT) representation of given feature type from points. More... | |
char * | Vect_line_to_wkt2 (const struct line_pnts *points, int type, bool with_z, bool trim) |
Create a Well Known Text (WKT) representation of given feature type from points. More... | |
Vector library - GEOS powered WKT and WKB export.
Higher level functions for reading/writing/manipulating vectors.
(C) 2015 by the GRASS Development Team
This program is free software under the GNU General Public License (>=v2). Read the file COPYING that comes with GRASS for details.
Definition in file geos_to_wktb.c.
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.
This function is not thread safe, it uses static variables for speedup.
Supported feature types:
points | pointer to line_pnts structure |
type | feature type (see supported types) |
with_z | Set to 1 if the feature is 3d, 0 otherwise |
size | The size of the returned byte array |
Definition at line 223 of file geos_to_wktb.c.
char* Vect_line_to_wkt | ( | const struct line_pnts * | points, |
int | type, | ||
bool | with_z | ||
) |
Create a Well Known Text (WKT) representation of given feature type from points.
Calls Vect_line_to_wkt2() with trim set to false.
Definition at line 259 of file geos_to_wktb.c.
char* Vect_line_to_wkt2 | ( | const struct line_pnts * | points, |
int | type, | ||
bool | with_z, | ||
bool | trim | ||
) |
Create a Well Known Text (WKT) representation of given feature type from points.
This function is not thread safe, it uses static variables for speedup.
Supported types:
points | pointer to line_pnts structure |
type | feature type (see supported types) |
with_z | Set to true if the feature is 3d, false otherwise |
trim | Set the number trimming option on, With trim set to true, the writer will strip trailing 0's from the output coordinates. |
Definition at line 285 of file geos_to_wktb.c.
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.
Map | pointer to Map_info structure |
area | area id |
size | The size of the returned unsigned char array |
Definition at line 34 of file geos_to_wktb.c.
References init(), NULL, and Vect_read_area_geos().
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.
Calls Vect_read_area_to_wkt2() with trim set to false.
Definition at line 71 of file geos_to_wktb.c.
References Vect_read_area_to_wkt2().
char* Vect_read_area_to_wkt2 | ( | struct Map_info * | Map, |
int | area, | ||
bool | trim | ||
) |
Read vector area and return it as Well Known Text (WKT) unsigned char array.
Map | pointer to Map_info structure |
area | area id |
size | The size of the returned unsigned char array |
trim | Set the number trimming option on, With trim set to true, the writer will strip trailing 0's from the output coordinates. |
Definition at line 89 of file geos_to_wktb.c.
References G_store(), init(), NULL, and Vect_read_area_geos().
Referenced by Vect_read_area_to_wkt().
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.
This function reads a specific feature and converts it into a WKB representation. line_pnts and line_cats structures can be provided to store the result of the read operation. That is meaningful in case the category values of the feature are needed. This function is not thread safe, it uses static variables for speedup.
Supported feature types:
Map | pointer to Map_info structure |
line_p | pointer to line_pnts structure to use, or NULL |
line_c | pointer to line_cats structure to use, or NULL |
line | The id of the feature to read |
size | The size of the returned unsigned char array |
Definition at line 146 of file geos_to_wktb.c.