33static int Tot_mem = 0;
94 G_debug(3,
"Reading vector areas (nareas = %d)", n);
95 for (area = 1; area <= n; area++) {
102 gln->highlighted = 0;
116 Tot_mem += (np *
sizeof(
Point3));
127 Tot_mem += (np *
sizeof(
Point2));
131 for (i = 0; i < np; i++) {
133 gln->p3[i][
X] = points->
x[i];
134 gln->p3[i][
Y] = points->
y[i];
135 gln->p3[i][
Z] = points->
z[i];
138 gln->p2[i][
X] = points->
x[i];
139 gln->p2[i][
Y] = points->
y[i];
170 G_debug(3,
"Reading vector lines ...");
172 G_debug(3,
"line type = %d", type);
184 gln->highlighted = 0;
197 Tot_mem += (np *
sizeof(
Point3));
208 Tot_mem += (np *
sizeof(
Point2));
212 for (i = 0; i < np; i++) {
214 gln->p3[i][
X] = points->
x[i];
215 gln->p3[i][
Y] = points->
y[i];
216 gln->p3[i][
Z] = points->
z[i];
219 gln->p2[i][
X] = points->
x[i];
220 gln->p2[i][
Y] = points->
y[i];
237 if (
Cats->n_cats > 0) {
275 _(
"No features from vector map <%s> fall within current region"),
280 G_message(
_(
"Vector map <%s> loaded (%d features)"),
287 G_debug(3,
"Total vect memory = %d Kbytes", Tot_mem / 1000);
334 if (!
gv || !
gv->tstyle || !
gv->filename)
350 G_warning(
_(
"Database connection not defined for layer %d"),
357 Fi->database,
Fi->driver);
359 G_message(
_(
"Loading thematic vector layer <%s>..."),
367 gvt->style->color =
gv->style->color;
368 gvt->style->symbol =
gv->style->symbol;
369 gvt->style->size =
gv->style->size;
370 gvt->style->width =
gv->style->width;
384 G_warning(
_(
"No color rule defined for category %d"), cat);
385 gvt->style->color =
gv->style->color;
392 if (
gv->tstyle->color_column) {
394 gv->tstyle->color_column, &value);
401 G_warning(
_(
"Invalid color definition (%s)"), str);
402 gvt->style->color =
gv->style->color;
412 if (
gv->tstyle->width_column) {
414 gv->tstyle->width_column, &value);
425 _(
"%d features without category. "
426 "Unable to determine color rules for features without category."),
Main header of GRASS DataBase Management Interface.
int G_str_to_color(const char *, int *, int *, int *)
Parse color string and set red,green,blue.
int db_select_value(dbDriver *, const char *, const char *, int, const char *, dbValue *)
Select one (first) value from table/column for key/id.
int db_get_value_int(dbValue *)
Get integer value.
dbDriver * db_start_driver_open_database(const char *, const char *)
Open driver/database connection.
const char * db_get_value_string(dbValue *)
Get string value.
void G_zero(void *, int)
Zero out a buffer, buf, of length i.
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
void G_get_set_window(struct Cell_head *)
Get the current working window (region)
char * G_fully_qualified_name(const char *, const char *)
Get fully qualified element name.
void G_message(const char *,...) __attribute__((format(printf
int G_debug(int, const char *,...) __attribute__((format(printf
const char * G_find_vector2(const char *, const char *)
Find a vector map (look but don't touch)
void GS_v3cross(float *, float *, float *)
Get the cross product v3 = v1 cross v2.
int Rast_get_c_color(const CELL *, int *, int *, int *, struct Colors *)
Gets color from raster map (CELL)
plus_t Vect_get_num_areas(struct Map_info *)
Get number of areas in vector map.
int Vect_reset_cats(struct line_cats *)
Reset category structure to make sure cats structure is clean to be re-used.
int Vect_cat_get(const struct line_cats *, int, int *)
Get first found category of given field.
int Vect_set_constraint_region(struct Map_info *, double, double, double, double, double, double)
Set constraint region.
int Vect_get_area_points(struct Map_info *, int, struct line_pnts *)
Returns polygon array of points (outer ring) of given area.
int Vect_close(struct Map_info *)
Close vector map.
struct field_info * Vect_get_field(struct Map_info *, int)
Get information about link to database (by layer number)
int Vect_open_old(struct Map_info *, const char *, const char *)
Open existing vector map for reading.
struct line_cats * Vect_new_cats_struct(void)
Creates and initializes line_cats structure.
int Vect_read_next_line(struct Map_info *, struct line_pnts *, struct line_cats *)
Read next vector feature.
struct line_pnts * Vect_new_line_struct(void)
Creates and initializes a line_pnts structure.
int Vect_set_open_level(int)
Predetermine level at which a vector map will be opened for reading.
int Vect_is_3d(struct Map_info *)
Check if vector map is 3D.
#define PORT_DOUBLE_MAX
Limits for portable types.
int Gv_load_vect_thematic(geovect *gv, struct Colors *colors)
Load styles for geolines based on thematic mapping.
void sub_Vectmem(int minus)
Tracking memory.
geoline * Gv_load_vect(const char *grassname, int *nlines)
Load vector map to memory.
OGSF header file (structures)
struct g_line geoline
Line instance.
2D/3D raster map header (used also for region)
double north
Extent coordinates (north)
double east
Extent coordinates (east)
double top
Extent coordinates (top) - 3D data.
double south
Extent coordinates (south)
double west
Extent coordinates (west)
Layer (old: field) information.
char * driver
Name of DB driver ('sqlite', 'dbf', ...)
Struct for vector feature displaying attributes.
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.