47 G_debug(3,
"Vect_read_line_geos(): line = %d", line);
51 _(
"vector map is not opened"));
55 _(
"Vect_read_line_geos(): feature id %d is not reasonable "
56 "(max features in vector map <%s>: %d)"),
61 _(
"only native format supported"));
63 Line =
Map->plus.Line[line];
66 _(
"Attempt to read dead line"), line);
87 G_debug(3,
"Vect_read_area_geos(): area = %d", area);
91 G_fatal_error(
_(
"Vect_read_area_geos(): unable to read area id %d"),
97 for (i = 0; i <
nholes; i++) {
106 G_fatal_error(
_(
"Vect_read_area_geos(): unable to read isle id %d "
142 G_debug(3,
"Vect_line_to_geos(): type = %d",
type);
161 for (i = 0; i < points->
n_points; i++) {
211 G_debug(3,
" geos_type = point");
215 G_debug(3,
" geos_type = linestring");
223 G_debug(3,
" geos_type = linearring");
226 G_debug(3,
" geos_type = linestring");
255 G_debug(3,
"V2_read_line_geos(): line = %d", line);
257 Line =
Map->plus.Line[line];
261 _(
"Attempt to read dead line"), line);
323 if (
Map->head.coor_version.minor == 1) {
332 G_debug(3,
" n_cats = %d", n_cats);
334 if (
Map->head.coor_version.minor == 1) {
351 G_debug(3,
" n_points = %d dim = %d", n_points,
352 (
Map->head.with_z) ? 3 : 2);
354 x = (
double *)
G_malloc(n_points *
sizeof(
double));
355 y = (
double *)
G_malloc(n_points *
sizeof(
double));
356 if (
Map->head.with_z)
357 z = (
double *)
G_malloc(n_points *
sizeof(
double));
369 if (
Map->head.with_z) {
377 for (i = 0; i < n_points; i++) {
380 if (
Map->head.with_z)
414 G_debug(3,
"Vect_get_area_points_geos(): area = %d", area);
417 Area =
Plus->Area[area];
420 G_warning(
_(
"Attempt to read points of nonexistent area id %d"), area);
445 G_debug(3,
"Vect_get_isle_points_geos(): isle = %d",
isle);
470 for (i = 0; i <
n_lines; i++) {
473 G_debug(3,
" append line(%d) = %d", i, line);
486 G_debug(3,
" line n_points = %d", n_points);
493 for (i = 0; i <
n_lines; i++) {
496 for (
j = 0;
j < (
int)n_points;
j++, k++) {
503 if (
Map->head.with_z) {
510 for (
j = (
int)n_points - 1;
j > -1;
j--, k++) {
517 if (
Map->head.with_z) {
void G_free(void *)
Free allocated memory.
void void void void G_fatal_error(const char *,...) __attribute__((format(printf
void G_warning(const char *,...) __attribute__((format(printf
int G_debug(int, const char *,...) __attribute__((format(printf
int Vect_get_area_isle(struct Map_info *, int, int)
Returns isle id for area.
int Vect_get_area_num_isles(struct Map_info *, int)
Returns number of isles for given area.
const char * Vect_get_full_name(struct Map_info *)
Get fully qualified name of vector map.
#define GV_POINT
Feature types used in memory on run time (may change)
#define VECT_OPEN(Map)
Check if vector map is open.
#define GV_FORWARD
Line direction indicator forward/backward.
#define GV_FORMAT_NATIVE
Geometry data formats supported by lib Don't change GV_FORMAT_* values, this order is hardcoded in li...
int dig__fread_port_D(double *, size_t, struct gvfile *)
Read doubles from the Portable Vector Format.
off_t dig_ftell(struct gvfile *file)
Get struct gvfile position.
int dig_set_cur_port(struct Port_info *)
Set current Port_info structure.
int dig__fread_port_C(char *, size_t, struct gvfile *)
Read chars from the Portable Vector Format.
int dig__fread_port_I(int *, size_t, struct gvfile *)
Read integers from the Portable Vector Format.
int dig_fseek(struct gvfile *file, off_t offset, int whence)
Set struct gvfile position.
int dig_type_from_store(int)
Convert type from store type.
GEOSGeometry * Vect_read_line_geos(struct Map_info *Map, int line, int *type)
Read vector feature and stores it as GEOSGeometry instance.
GEOSCoordSequence * Vect_get_area_points_geos(struct Map_info *Map, int area)
Returns the polygon array of points, i.e. outer ring (shell)
GEOSCoordSequence * Vect_get_isle_points_geos(struct Map_info *Map, int isle)
Returns the polygon (isle) array of points (inner ring)
GEOSGeometry * Vect_line_to_geos(const struct line_pnts *points, int type, int with_z)
Create GEOSGeometry of given type from feature points.
GEOSGeometry * Vect_read_area_geos(struct Map_info *Map, int area)
Read vector area and stores it as GEOSGeometry instance (polygon)
plus_t n_lines
Number of boundary lines.
plus_t * lines
List of boundary lines.
plus_t * lines
List of boundary lines.
plus_t n_lines
Number of boundary lines.
off_t offset
Offset in coor file for line.
Basic topology-related info.
Feature geometry info - coordinates.
double * y
Array of Y coordinates.
double * x
Array of X coordinates.
int n_points
Number of points.
double * z
Array of Z coordinates.
struct GEOSCoordSeq_t GEOSCoordSequence
struct GEOSGeom_t GEOSGeometry