1 #ifndef GRASS_VECTORDEFS_H 2 #define GRASS_VECTORDEFS_H 14 double *,
double *,
double *);
26 double *,
double *,
double *);
31 double *,
double *,
double *,
double *,
double *,
34 double *,
double *,
double *,
double *,
double *,
40 double,
int,
int,
double,
44 double,
int,
int,
double,
48 double,
int,
int,
double,
85 int,
int,
struct varray *);
93 const char *,
const char *,
const char *,
const char *);
96 const char *,
const char *,
const char *,
249 double,
double,
double);
331 double,
int,
const struct ilist *,
struct ilist *);
372 double,
int,
int *,
int *);
401 const char *,
const char *,
int,
int);
403 const char *,
const char *,
const char *,
int,
int);
407 struct ilist *,
double *);
412 double,
int *,
int *,
int *,
double *,
double *,
415 double,
double,
double,
double,
double,
420 double,
double,
double,
double,
double,
int,
432 int Vect_copy(
const char *,
const char *,
const char *);
437 const char *,
int,
const struct cat_list *);
439 const char *,
int,
int *,
int);
443 double,
double,
double,
double,
double,
double,
444 double *,
double *,
double *,
double *,
445 double *,
double *,
int);
473 int,
int,
char *,
int,
int,
474 int,
const struct cat_list *,
const char*,
618 int,
size_t *,
int *);
int V2_open_old_pg(struct Map_info *)
Open vector map - PostGIS feature table on topological level.
int Vect_get_area_box(const struct Map_info *, int, struct bound_box *)
Get bounding box of area.
void Vect_destroy_boxlist(struct boxlist *)
Frees all memory associated with a struct boxlist, including the struct itself.
int Vect_open_new(struct Map_info *, const char *, int)
Create new vector map for reading/writing.
int Vect_build_pg(struct Map_info *, int)
Build topology for PostGIS layer.
int Vect_append_points(struct line_pnts *, const struct line_pnts *, int)
Appends points to the end of a line.
int Vect_net_ttb_build_graph(struct Map_info *, int, int, int, int, int, const char *, const char *, const char *, int, int)
Build network graph with turntable.
void Vect_graph_build(dglGraph_s *)
Build network graph.
int V1_open_old_nat(struct Map_info *, int)
Open existing vector map (level 1)
void Vect_chtype_bridges(struct Map_info *, struct Map_info *, int *, int *)
Change type of bridges in vector map.
void Vect_remove_dangles(struct Map_info *, int, double, struct Map_info *)
Remove dangles from vector map.
int Vect_boxlist_delete_boxlist(struct boxlist *, const struct boxlist *)
Delete list from existing list.
void Vect_line_parallel2(struct line_pnts *, double, double, double, int, int, double, struct line_pnts *)
int Vect_set_varray_from_cat_string(const struct Map_info *, int, const char *, int, int, struct varray *)
Set values in 'varray' to 'value' from category string.
int Vect_point_in_poly(double, double, const struct line_pnts *)
Determines if a point (X,Y) is inside a polygon.
int Vect_get_updated_line(const struct Map_info *, int)
Get updated line by index.
int Vect_build_line_area(struct Map_info *, int, int)
Build area on given side of line (GV_LEFT or GV_RIGHT)
void Vect__init_head(struct Map_info *)
Initialize Map_info head structure (dig_head)
const char * Vect_maptype_info(const struct Map_info *)
Gets vector map format (as string)
int Vect_get_area_cats(const struct Map_info *, int, struct line_cats *)
Get area categories.
int Vect_cat_in_array(int, const int *, int)
Check if category is in ordered array of integers.
int Vect_set_map_name(struct Map_info *, const char *)
Set map name in map header.
const char * Vect_get_proj_name(const struct Map_info *)
Query cartographic projection name of pointer to Map_info structure.
int Vect_hist_command(struct Map_info *)
Write command info to history file.
const char * Vect_get_column_names_types(const struct Map_info *, int)
Fetches list of DB column names and types of vector map attribute table.
int Vect_set_comment(struct Map_info *, const char *)
Set comment or other info string in map header.
int V2_delete_line_pg(struct Map_info *, off_t)
Deletes feature on topological level (PostGIS interface)
int Vect_get_area_isle(const struct Map_info *, int, int)
Returns isle id for area.
int Vect_line_get_point(const struct line_pnts *, int, double *, double *, double *)
Get line point of given index.
int Vect_attach_isles(struct Map_info *, const struct bound_box *)
(Re)Attach isles in given bounding box to areas
int Vect_select_areas_by_box(struct Map_info *, const struct bound_box *, struct boxlist *)
Select areas with bounding boxes by box.
int Vect_delete(const char *)
Delete vector map including attribute tables.
plus_t Vect_get_num_nodes(const struct Map_info *)
Get number of nodes in vector map.
int Vect_field_cat_get(const struct line_cats *, int, struct ilist *)
Get list of categories of given field.
int Vect_cidx_find_next(const struct Map_info *, int, int, int, int, int *, int *)
Find next line/area id for given category, start_index and type_mask.
int Vect_check_input_output_name(const char *, const char *, int)
Check for input and output vector map name.
int Vect_save_frmt(struct Map_info *)
Save format definition file for vector map.
int Vect_point_in_island(double, double, const struct Map_info *, int, struct bound_box *)
Determines if a point (X,Y) is inside an island.
int Vect_get_map_box(const struct Map_info *, struct bound_box *)
Get bounding box of map (all features in the map)
int Vect_reset_list(struct ilist *)
Reset ilist structure.
int Vect_open_tmp_new(struct Map_info *, const char *, int)
Create new temporary vector map.
int Vect_open_update_head(struct Map_info *, const char *, const char *)
Open header file of existing vector map for updating (mostly for database link updates) ...
int V2_read_line_sfa(struct Map_info *, struct line_pnts *, struct line_cats *, int)
Reads feature from OGR/PostGIS layer on topological level.
void Vect_graph_add_edge(dglGraph_s *, int, int, double, int)
Add edge to graph.
int Vect_build_nat(struct Map_info *, int)
Build topology.
void Vect_remove_duplicates(struct Map_info *, int, struct Map_info *)
Remove duplicate features from vector map.
void Vect_remove_constraints(struct Map_info *)
Remove all constraints.
int Vect_select_isles_by_box(struct Map_info *, const struct bound_box *, struct boxlist *)
Select isles with bounding boxes by box.
int Vect_print_header(const struct Map_info *)
Print vector map header to stdout.
int Vect_net_shortest_path_coor(struct Map_info *, double, double, double, double, double, double, double, double, double *, struct line_pnts *, struct ilist *, struct ilist *, struct line_pnts *, struct line_pnts *, double *, double *)
Find shortest path on network between 2 points given by coordinates.
unsigned char * Vect_read_area_to_wkb(struct Map_info *, int, size_t *)
Read vector area and return it as Well Known Binary (WKB) unsigned char array.
int Vect_list_delete(struct ilist *, int)
Remove a given value (item) from list.
int Vect_topo_check(struct Map_info *, struct Map_info *)
Extensive tests for correct topology.
int Vect_remove_small_areas(struct Map_info *, double, struct Map_info *, double *)
Remove small areas from the map map.
int Vect_select_nodes_by_box(struct Map_info *, const struct bound_box *, struct ilist *)
Select nodes by box.
int Vect_cidx_get_num_fields(const struct Map_info *)
Get number of layers in category index.
int Vect_map_add_dblink(struct Map_info *, int, const char *, const char *, const char *, const char *, const char *)
Add new db connection to Map_info structure.
int Vect_box_copy(struct bound_box *, const struct bound_box *)
Copy box B to box A.
int Vect_graph_shortest_path(dglGraph_s *, int, int, struct ilist *, double *)
Find shortest path.
2D/3D raster map header (used also for region)
int Vect_attach_centroids(struct Map_info *, const struct bound_box *)
(Re)Attach centroids in given bounding box to areas
int V2_open_old_ogr(struct Map_info *)
Open existing OGR layer on topological level.
int Vect_net_nearest_nodes(struct Map_info *, double, double, double, int, double, int *, int *, int *, double *, double *, struct line_pnts *, struct line_pnts *, double *)
Find nearest node(s) on network.
int Vect_cat_del(struct line_cats *, int)
Delete all categories of given layer.
plus_t Vect_get_num_lines(const struct Map_info *)
Fetch number of features (points, lines, boundaries, centroids) in vector map.
off_t Vect_rewrite_line(struct Map_info *, off_t, int, const struct line_pnts *, const struct line_cats *)
Rewrites existing feature (topological level required)
int Vect_sfa_get_type(SF_FeatureType)
Get relevant GV type.
int Vect_get_area_centroid(const struct Map_info *, int)
Returns centroid id for given area.
off_t Vect_get_line_offset(const struct Map_info *, int)
Get feature offset (topological level required)
int Vect_set_thresh(struct Map_info *, double)
Set threshold used for digitization in map header.
int Vect_merge_lines(struct Map_info *, int, int *, struct Map_info *)
Merge lines or boundaries in vector map.
int Vect_cidx_get_num_types_by_index(const struct Map_info *, int)
Get number of feature types for given layer index.
int Vect_point_in_area_outer_ring(double, double, const struct Map_info *, int, struct bound_box *)
Determines if a point (X,Y) is inside an area outer ring. Islands are not considered.
int Vect_cidx_get_unique_cats_by_index(struct Map_info *, int, struct ilist *)
Get list of unique categories for given layer index.
int Vect_open_tmp_old(struct Map_info *, const char *, const char *)
Open existing temporary vector map for reading.
int Vect_open_update(struct Map_info *, const char *, const char *)
Open existing vector map for reading/writing.
off_t V2_rewrite_line_pg(struct Map_info *, off_t, int, const struct line_pnts *, const struct line_cats *)
Rewrites feature at topological level (PostGIS interface, internal use only)
const struct Format_info * Vect_get_finfo(const struct Map_info *)
Get header info for non-native formats.
GEOSCoordSequence * Vect_get_area_points_geos(struct Map_info *, int)
Returns the polygon array of points, i.e. outer ring (shell)
int V1_delete_line_pg(struct Map_info *, off_t)
Deletes feature at the given offset (level 1)
struct field_info * Vect_get_field_by_name(const struct Map_info *, const char *)
Get information about link to database (by layer name)
int V1_delete_line_ogr(struct Map_info *, off_t)
Deletes feature at the given offset on level 1 (OGR interface)
dglGraph_s * Vect_net_get_graph(struct Map_info *)
Get graph structure.
plus_t Vect_get_num_faces(const struct Map_info *)
Get number of faces in vector map.
int Vect_copy_table_by_cats(const struct Map_info *, struct Map_info *, int, int, const char *, int, int *, int)
Copy attribute table linked to vector map based on category numbers.
int Vect_net_build_graph(struct Map_info *, int, int, int, const char *, const char *, const char *, int, int)
Build network graph.
int Vect_rename(const char *, const char *)
Rename existing vector map (in the current mapset).
int Vect_write_ascii(FILE *, FILE *, struct Map_info *, int, int, int, char *, int, int, int, const struct cat_list *, const char *, const char **, int)
Write data to GRASS ASCII vector format.
int Vect_check_dblink(const struct dblinks *, int, const char *)
Check if DB connection exists in dblinks structure.
int Vect__intersect_line_with_poly(const struct line_pnts *, double, struct line_pnts *)
off_t V1_write_line_nat(struct Map_info *, int, const struct line_pnts *, const struct line_cats *)
Writes feature to 'coor' file at level 1 (internal use only)
int Vect_get_next_line_id(const struct Map_info *)
Get line id for sequential reading.
int Vect_set_constraint_type(struct Map_info *, int)
Set constraint type.
int V2_restore_line_nat(struct Map_info *, off_t, off_t)
Restores feature at topological level (internal use only)
void Vect_set_db_updated(struct Map_info *)
Rewrite 'dbln' file.
int Vect_val_in_list(const struct ilist *, int)
Find a given item in the list.
int Vect_copy_xyz_to_pnts(struct line_pnts *, const double *, const double *, const double *, int)
Copy points from array to line_pnts structure.
int V1_read_next_line_pg(struct Map_info *, struct line_pnts *, struct line_cats *)
Read next feature from PostGIS layer. Skip empty features (level 1 without topology). t This function implements sequential access.
int RTreeSearch2(struct RTree *, struct RTree_Rect *, struct ilist *)
int Vect_set_map_date(struct Map_info *, const char *)
Set date when the source map was originally produced in map header.
int Vect_copy_map_lines_field(struct Map_info *, int, struct Map_info *)
Copy all alive vector features from given layer from input vector map to output vector map...
int Vect_copy_head_data(const struct Map_info *, struct Map_info *)
Copy header data from one to another map.
int Vect_line_check_intersection2(struct line_pnts *, struct line_pnts *, int)
Check if 2 lines intersect.
int Vect_check_line_breaks(struct Map_info *, int, struct Map_info *)
Check for and count intersecting lines, do not break.
void Vect_destroy_cat_list(struct cat_list *)
Frees allocated cat_list memory.
GEOSCoordSequence * Vect_get_isle_points_geos(struct Map_info *, int)
Returns the polygon (isle) array of points (inner ring)
int Vect_check_line_breaks_list(struct Map_info *, struct ilist *, struct ilist *, int, struct Map_info *)
Check for and count intersecting lines, do not break.
int Vect_get_area_num_isles(const struct Map_info *, int)
Returns number of isles for given area.
int Vect_line_distance(const struct line_pnts *, double, double, double, int, double *, double *, double *, double *, double *, double *)
Calculate distance of point to line.
GEOSGeometry * Vect_read_area_geos(struct Map_info *, int)
Read vector area and stores it as GEOSGeometry instance (polygon)
int Vect_restore_line(struct Map_info *, off_t, off_t)
Restore previously deleted feature (topological level required)
double Vect_line_geodesic_length(const struct line_pnts *)
Calculate line length.
double Vect_get_thresh(const struct Map_info *)
Get threshold used for digitization from map header.
int Vect_close(struct Map_info *)
Close vector map.
int Vect_get_point_in_poly_isl(const struct line_pnts *, const struct line_pnts **, int, double *, double *)
Get point inside polygon but outside the islands specifiled in IPoints.
void Vect_chtype_dangles(struct Map_info *, double, struct Map_info *)
Change boundary dangles to lines.
SF_FeatureType Vect_sfa_get_line_type(const struct line_pnts *, int, int)
Get SF type of given vector feature.
int Vect_save_sidx(struct Map_info *)
Save spatial index file for vector map.
int Vect_isle_alive(const struct Map_info *, int)
Check if isle is alive or dead (topological level required)
int Vect_line_check_duplicate(const struct line_pnts *, const struct line_pnts *, int)
Check for duplicate lines.
int Vect_line_prune(struct line_pnts *)
Remove duplicate points, i.e. zero length segments.
double Vect_line_length(const struct line_pnts *)
Calculate line length, 3D-length in case of 3D vector line.
char * Vect_read_area_to_wkt(struct Map_info *, int)
Read vector area and return it as Well Known Text (WKT) unsigned char array.
void Vect_spatial_index_init(struct spatial_index *, int)
Initialize spatial index structure.
void Vect_line_box(const struct line_pnts *, struct bound_box *)
Get bounding box of line.
int Vect_sfa_line_astext(const struct line_pnts *, int, int, int, FILE *)
Export geometry to Well-Known Text.
double Vect_points_distance(double, double, double, double, double, double, int)
Calculate distance of 2 points.
int Vect_write_header(const struct Map_info *)
Write vector map header to map head file.
void Vect_graph_init(dglGraph_s *, int)
Initialize graph structure.
unsigned char * Vect_line_to_wkb(const struct line_pnts *, int, int, size_t *)
Create a Well Known Binary (WKB) representation of given feature type from points.
int V1_open_new_nat(struct Map_info *, const char *, int)
Create new vector map (level 1)
int Vect_cidx_get_num_cats_by_index(const struct Map_info *, int)
Get number of categories for given layer index.
int V2_read_next_line_pg(struct Map_info *, struct line_pnts *, struct line_cats *)
Read next feature from PostGIS layer on topological level (simple feature access).
int Vect_clean_small_angles_at_nodes(struct Map_info *, int, struct Map_info *)
Clean small angles at nodes.
int Vect_open_sidx(struct Map_info *, int)
Open spatial index file ('sidx')
int V1_read_line_ogr(struct Map_info *, struct line_pnts *, struct line_cats *, off_t)
Read feature from OGR layer at given offset (level 1 without topology)
int Vect_segment_intersection(double, double, double, double, double, double, double, double, double, double, double, double, double *, double *, double *, double *, double *, double *, int)
Check for intersect of 2 line segments.
double Vect_get_area_perimeter(const struct Map_info *, int)
Returns perimeter of area with perimeter of isles.
int Vect_get_node_n_lines(const struct Map_info *, int)
Get number of lines for node.
int Vect_add_dblink(struct dblinks *, int, const char *, const char *, const char *, const char *, const char *)
Add new DB connection to dblinks structure.
int V__map_overlap(struct Map_info *, double, double, double, double)
int Vect_sfa_is_line_closed(const struct line_pnts *, int, int)
Check if feature is closed.
int Vect_get_line_box(const struct Map_info *, int, struct bound_box *)
Get bounding box of given feature.
struct field_info * Vect_get_field(const struct Map_info *, int)
Get information about link to database (by layer number)
struct cat_list * Vect_new_cat_list(void)
Allocate memory for cat_list structure.
off_t V1_write_line_ogr(struct Map_info *, int, const struct line_pnts *, const struct line_cats *)
Writes feature on level 1 (OGR interface)
int Vect_get_num_dblinks(const struct Map_info *)
Get number of defined dblinks.
int Vect_line_geodesic_distance(const struct line_pnts *, double, double, double, int, double *, double *, double *, double *, double *, double *)
Calculate geodesic distance of point to line in meters.
int Vect_set_constraint_region(struct Map_info *, double, double, double, double, double, double)
Set constraint region.
int Vect_sfa_get_num_features(const struct Map_info *)
Get number of simple features.
void Vect_line_buffer2(const struct line_pnts *, double, double, double, int, int, double, struct line_pnts **, struct line_pnts ***, int *)
Creates buffer around line.
int Vect_build_ogr(struct Map_info *, int)
Build pseudo-topology (simple features) for OGR layer.
void Vect_set_release_support(struct Map_info *)
Set spatial index to be realease when vector is closed.
int Vect_list_append_list(struct ilist *, const struct ilist *)
Append new items to the end of list if not yet present.
plus_t Vect_get_num_primitives(const struct Map_info *, int)
Get number of primitives in vector map.
void Vect_snap_lines(struct Map_info *, int, double, struct Map_info *)
Snap lines in vector map to existing vertex in threshold.
int Vect_point_in_area(double, double, const struct Map_info *, int, struct bound_box *)
Check if point is in area.
int Vect_find_line(struct Map_info *, double, double, double, int, double, int, int)
Find the nearest line.
int Vect_get_node_coor(const struct Map_info *, int, double *, double *, double *)
Get node coordinates.
int Vect_cidx_get_field_number(const struct Map_info *, int)
Get layer number for given index.
void Vect_line_reverse(struct line_pnts *)
Reverse the order of vertices.
int Vect_str_to_cat_list(const char *, struct cat_list *)
Converts string of categories and cat ranges separated by commas to cat_list.
int Vect_get_zone(const struct Map_info *)
Get projection zone from map header.
int Vect_cidx_get_type_count(const struct Map_info *, int, int)
Get count of features of certain type by layer and type.
int Vect_line_intersection(struct line_pnts *, struct line_pnts *, struct bound_box *, struct bound_box *, struct line_pnts ***, struct line_pnts ***, int *, int *, int)
Intersect 2 lines.
int Vect_read_colors(const char *, const char *, struct Colors *)
Read color table of vector map.
Layer (old: field) information.
int Vect_line_segment(const struct line_pnts *, double, double, struct line_pnts *)
Create line segment.
const char * Vect_get_map_date(const struct Map_info *)
Get date when the source map was originally produced from map header.
off_t V1_write_line_pg(struct Map_info *, int, const struct line_pnts *, const struct line_cats *)
Writes feature on level 1 (PostGIS interface)
int Vect_read_dblinks(struct Map_info *)
Read dblinks to existing structure.
int Vect_hist_copy(const struct Map_info *, struct Map_info *)
Copy history from one map to another.
int V2_close_ogr(struct Map_info *)
Close vector map on topological level (write out fidx file)
int Vect_get_field_number(const struct Map_info *, const char *)
Get field number of given field.
int Vect_set_proj(struct Map_info *, int)
Set projection in map header.
const char * Vect_get_column_names(const struct Map_info *, int)
Fetches list of DB column names of vector map attribute table.
int Vect_build_sidx_from_topo(const struct Map_info *)
Create spatial index from topology if necessary (not longer supported)
int Vect_select_lines_by_box(struct Map_info *, const struct bound_box *, int, struct boxlist *)
Select lines with bounding boxes by box.
Feature geometry info - coordinates.
int V2_rewind_nat(struct Map_info *)
Rewind vector map to cause reads to start at beginning on topological level (level 2) - native format...
int Vect_open_topo(struct Map_info *, int)
Open topology file ('topo')
int Vect_overlay_and(struct Map_info *, int, struct ilist *, struct ilist *, struct Map_info *, int, struct ilist *, struct ilist *, struct Map_info *)
Overlay 2 vector maps with AND.
off_t Vect_get_updated_line_offset(const struct Map_info *, int)
Get updated line offset by index.
char * Vect_line_to_wkt(const struct line_pnts *, int, int)
Create a Well Known Text (WKT) representation of given feature type from points.
int Vect_cidx_dump(const struct Map_info *, FILE *)
Write (dump) category index in text form to file.
int Vect_get_centroid_area(const struct Map_info *, int)
Get area id the centroid is within.
void Vect_point_buffer2(double, double, double, double, double, int, double, struct line_pnts **)
Creates buffer around the point (px, py).
int Vect_get_num_line_points(const struct line_pnts *)
Get number of line points.
void Vect_break_lines(struct Map_info *, int, struct Map_info *)
Break lines in vector map at each intersection.
void Vect_select_dangles(struct Map_info *, int, double, struct ilist *)
Select dangles from vector map.
int Vect_get_node_line(const struct Map_info *, int, int)
Get line id for node line index.
int Vect_open_old_head2(struct Map_info *, const char *, const char *, const char *)
Reads only info about vector map (headers)
int Vect_read_ascii_head(FILE *, struct Map_info *)
Read header of GRASS ASCII vector format.
char * Vect_subst_var(const char *, const struct Map_info *)
Substitute variable in string.
char * Vect_get_finfo_layer_name(const struct Map_info *)
Get layer name (relevant only for non-native formats)
int V1_rewind_pg(struct Map_info *)
Rewind vector map (PostGIS layer) to cause reads to start at beginning (level 1)
int Vect_cidx_get_cat_by_index(const struct Map_info *, int, int, int *, int *, int *)
Get category, feature type and id for given layer and category index.
int Vect_get_point_in_poly(const struct line_pnts *, double *, double *)
Get point inside polygon.
unsigned char * Vect_read_line_to_wkb(const struct Map_info *, struct line_pnts *, struct line_cats *, int, size_t *, int *)
Read a Well Known Binary (WKB) representation of a given feature id.
void Vect_destroy_list(struct ilist *)
Frees all memory associated with a struct ilist, including the struct itself.
int Vect_get_finfo_topology_info(const struct Map_info *, char **, char **, int *)
Get topology type (relevant only for non-native formats)
void Vect_write_colors(const char *, const char *, struct Colors *)
Write color table for vector map.
int Vect_copy(const char *, const char *, const char *)
Copy vector map including attribute tables.
int Vect_build(struct Map_info *)
Build topology for vector map.
struct line_pnts * Vect_new_line_struct(void)
Creates and initializes a line_pnts structure.
int Vect_maptype(const struct Map_info *)
Gets vector map format.
void Vect_destroy_cats_struct(struct line_cats *)
Frees all memory associated with line_cats structure, including the struct itself.
int Vect_sfa_check_line_type(const struct line_pnts *, int, SF_FeatureType, int)
Check SF type.
GEOSGeometry * Vect_line_to_geos(const struct line_pnts *, int, int)
Create GEOSGeometry of given type from feature points.
int Vect_line_get_intersections(struct line_pnts *, struct line_pnts *, struct line_pnts *, int)
Get 2 lines intersection points.
int Vect_set_date(struct Map_info *, const char *)
Set date of digitization in map header.
int Vect_set_varray_from_cat_list(const struct Map_info *, int, struct cat_list *, int, int, struct varray *)
Set values in 'varray' to 'value' from category list.
struct field_info * Vect_get_dblink(const struct Map_info *, int)
Get information about link to database.
void Vect_reset_dblinks(struct dblinks *)
Reset dblinks structure (number of fields)
int Vect_get_proj(const struct Map_info *)
Get projection from map header.
char * Vect_sfa_line_geometry_type(const struct line_pnts *, int)
Get geometry type (string)
int Vect_find_node(struct Map_info *, double, double, double, double, int)
Find the nearest node.
void Vect_set_category_index_update(struct Map_info *)
Set category index to be updated when vector is changed.
int Vect_attach_isle(struct Map_info *, int, const struct bound_box *)
(Re)Attach isle to area
struct GEOSGeom_t GEOSGeometry
void Vect_area_buffer2(const struct Map_info *, int, double, double, double, int, int, double, struct line_pnts **, struct line_pnts ***, int *)
Creates buffer around area.
int Vect_isle_find_area(struct Map_info *, int, const struct bound_box *)
Find area outside island.
off_t Vect_write_line(struct Map_info *, int, const struct line_pnts *, const struct line_cats *)
Writes a new feature.
int Vect_fidx_dump(const struct Map_info *, FILE *)
Dump feature index to file.
int Vect_get_constraint_box(const struct Map_info *, struct bound_box *)
Get constraint box.
int Vect_get_isle_points(const struct Map_info *, int, struct line_pnts *)
Returns polygon array of points for given isle.
float Vect_get_node_line_angle(const struct Map_info *, int, int)
Angle of segment of the line connected to the node.
int V1_rewind_ogr(struct Map_info *)
Rewind vector map (OGR layer) to cause reads to start at beginning (level 1)
int Vect_build_sidx(struct Map_info *)
Create spatial index if necessary.
struct dblinks * Vect_new_dblinks_struct(void)
Create and init new dblinks structure.
int Vect_append_point(struct line_pnts *, double, double, double)
Appends one point to the end of a line.
int V1_close_ogr(struct Map_info *)
Close vector map (OGR dsn & layer) on level 1.
int Vect_line_get_intersections2(struct line_pnts *, struct line_pnts *, struct line_pnts *, int)
Get 2 lines intersection points.
int Vect_val_in_boxlist(const struct boxlist *, int)
Find a given item in the list.
off_t V2_rewrite_line_nat(struct Map_info *, off_t, int, const struct line_pnts *, const struct line_cats *)
Rewrites feature to 'coor' file at topological level (internal use only)
off_t V1_rewrite_line_pg(struct Map_info *, off_t, int, const struct line_pnts *, const struct line_cats *)
Rewrites feature at the given offset (level 1) (PostGIS interface, internal use only) ...
int V2_read_line_nat(struct Map_info *, struct line_pnts *, struct line_cats *, int)
Read vector feature on topological level (level 2) - native format - internal use only...
int Vect_copy_pnts_to_xyz(const struct line_pnts *, double *, double *, double *, int *)
Copy points from line structure to array.
int V1_open_old_pg(struct Map_info *, int)
Open vector map - PostGIS feature table on non-topological level.
int Vect_get_area_boundaries(const struct Map_info *, int, struct ilist *)
Creates list of boundaries for given area.
int Vect_spatial_index_select(const struct spatial_index *, const struct bound_box *, struct ilist *)
Select items by bounding box to list.
const char * Vect_get_organization(const struct Map_info *)
Get organization string from map header.
int Vect_overlay_str_to_operator(const char *)
Get operator code from string.
int Vect_get_point_in_area(const struct Map_info *, int, double *, double *)
Get point inside area and outside all islands.
int Vect_map_del_dblink(struct Map_info *, int)
Delete db connection from Map_info structure.
plus_t Vect_get_num_areas(const struct Map_info *)
Get number of areas in vector map.
int V2_read_next_line_nat(struct Map_info *, struct line_pnts *, struct line_cats *)
Read next vector feature on topological level (level 2) - native format - internal use only...
int Vect_copy_map_lines(struct Map_info *, struct Map_info *)
Copy all alive vector features from input vector map to output vector map.
int Vect_box_extend(struct bound_box *, const struct bound_box *)
Extend box A by box B.
void Vect_set_error_handler_io(struct Map_info *, struct Map_info *)
Define standard error handler for input and output vector maps.
int Vect_set_constraint_field(struct Map_info *, int)
Set constraint field.
GEOSGeometry * Vect_read_line_geos(struct Map_info *, int, int *)
Read vector feature and stores it as GEOSGeometry instance.
int V1_close_nat(struct Map_info *)
Close vector map.
int V2_read_line_pg(struct Map_info *, struct line_pnts *, struct line_cats *, int)
Read feature from PostGIS layer on topological level.
void Vect_line_parallel(struct line_pnts *, double, double, int, struct line_pnts *)
Create parallel line.
int Vect_get_isle_boundaries(const struct Map_info *, int, struct ilist *)
Creates list of boundaries for given isle.
int Vect_area_alive(const struct Map_info *, int)
Check if area is alive or dead (topological level required)
void Vect_break_polygons(struct Map_info *, int, struct Map_info *)
Break polygons in vector map.
int Vect_topo_dump(const struct Map_info *, FILE *)
Dump topology to file.
int Vect_get_num_updated_nodes(const struct Map_info *)
Get number of updated nodes.
int V1_read_line_pg(struct Map_info *, struct line_pnts *, struct line_cats *, off_t)
Read feature from PostGIS layer at given offset (level 1 without topology)
int Vect__build_sfa(struct Map_info *, int)
Build pseudo-topology (for simple features) - internal use only.
int Vect_cidx_save(struct Map_info *)
Save category index to binary file (cidx)
int V1_read_next_line_ogr(struct Map_info *, struct line_pnts *, struct line_cats *)
Read next feature from OGR layer. Skip empty features (level 1 without topology). ...
off_t V1_rewrite_line_ogr(struct Map_info *, off_t, int, const struct line_pnts *, const struct line_cats *)
Rewrites feature at the given offset on level 1 (OGR interface)
int Vect_reset_cats(struct line_cats *)
Reset category structure to make sure cats structure is clean to be re-used.
off_t V1_rewrite_line_nat(struct Map_info *, off_t, int, const struct line_pnts *, const struct line_cats *)
Rewrites feature to 'coor' file at level 1 (internal use only)
int Vect_legal_filename(const char *)
Check if output is legal vector name.
int Vect_net_get_node_cost(const struct Map_info *, int, double *)
Get cost of node.
int Vect_rewind(struct Map_info *)
Rewind vector map to cause reads to start at beginning.
struct varray * Vect_new_varray(int)
Create new struct varray and allocate space for given number of items.
int Vect_get_isle_box(const struct Map_info *, int, struct bound_box *)
Get bounding box of isle.
off_t V2_rewrite_line_sfa(struct Map_info *, off_t, int, const struct line_pnts *, const struct line_cats *)
Rewrites feature at the given offset on level 2 (OGR/PostGIS interface, pseudo-topological level) ...
int V2_rewind_ogr(struct Map_info *)
Rewind vector map (OGR layer) to cause reads to start at beginning on topological level (level 2) ...
int Vect_set_open_level(int)
Predetermine level at which a vector map will be opened for reading.
int Vect_get_isle_area(const struct Map_info *, int)
Returns area id for isle.
struct GEOSCoordSeq_t GEOSCoordSequence
int Vect_reset_boxlist(struct boxlist *)
Reset boxlist structure.
int Vect_get_built(const struct Map_info *)
Return current highest built level (part)
int Vect_get_line_nodes(const struct Map_info *, int, int *, int *)
Get line nodes.
int Vect_line_intersection2(struct line_pnts *, struct line_pnts *, struct bound_box *, struct bound_box *, struct line_pnts ***, struct line_pnts ***, int *, int *, int)
Intersect 2 lines.
int Vect_find_area(struct Map_info *, double, double)
Find the nearest area.
const char * Vect_get_map_name(const struct Map_info *)
Get map name from map header.
int Vect_boxlist_append_boxlist(struct boxlist *, const struct boxlist *)
Append new items to the end of list if not yet present.
void Vect_cidx_find_all(const struct Map_info *, int, int, int, struct ilist *)
Find all line/area id's for given category.
int Vect_net_get_line_cost(const struct Map_info *, int, int, double *)
Returns in cost for given direction in *cost.
int Vect_open_old_head(struct Map_info *, const char *, const char *)
Reads only info about vector map (headers)
char * Vect_hist_read(char *, int, const struct Map_info *)
Reads one line from history file without newline character.
void Vect_snap_lines_list(struct Map_info *, const struct ilist *, double, struct Map_info *)
Snap selected lines to existing vertex in threshold.
int V1_delete_line_nat(struct Map_info *, off_t)
Deletes feature at level 1 (internal use only)
void Vect_line_buffer(const struct line_pnts *, double, double, struct line_pnts *)
Create buffer around the line line.
off_t V2_write_line_sfa(struct Map_info *, int, const struct line_pnts *, const struct line_cats *)
Writes feature on level 2 (OGR/PostGIS interface, pseudo-topological level)
const char * Vect_get_date(const struct Map_info *)
Get date of digitization from map header.
int Vect_hist_write(struct Map_info *, const char *)
Write string to history file.
int V1_rewind_nat(struct Map_info *)
Rewind vector map to cause reads to start at beginning on non-topological level (level 1) - native fo...
int Vect_sfa_line_dimension(int)
Get geometry dimension.
int Vect_cidx_get_type_count_by_index(const struct Map_info *, int, int, int *, int *)
Get count of feature types for given field and type index.
struct field_info * Vect_default_field_info(struct Map_info *, int, const char *, int)
Get default information about link to database for new dblink.
int Vect_cat_in_cat_list(int, const struct cat_list *)
Check if category number is in list.
int Vect_boxlist_append(struct boxlist *, int, const struct bound_box *)
Append new item to the end of list if not yet present.
int Vect_write_dblinks(struct Map_info *)
Write dblinks to file.
int Vect_point_in_box(double, double, double, const struct bound_box *)
Tests if point is in 3D box.
int V1_restore_line_nat(struct Map_info *, off_t, off_t)
Restores feature at level 1 (internal use only)
int V2_delete_line_nat(struct Map_info *, off_t)
Deletes feature at topological level (internal use only)
struct ilist * Vect_new_list(void)
Creates and initializes a struct ilist.
int Vect_is_3d(const struct Map_info *)
Check if vector map is 3D.
int Vect_delete_line(struct Map_info *, off_t)
Delete existing feature (topological level required)
off_t V2_write_line_nat(struct Map_info *, int, const struct line_pnts *, const struct line_cats *)
Writes feature to 'coor' file at topological level (internal use only)
struct line_cats * Vect_new_cats_struct(void)
Creates and initializes line_cats structure.
int V1_read_line_nat(struct Map_info *, struct line_pnts *, struct line_cats *, off_t)
Read vector feature on non-topological level (level 1) - native format - internal use only...
int Vect_find_poly_centroid(const struct line_pnts *, double *, double *)
Get centroid of polygon.
plus_t Vect_get_num_holes(const struct Map_info *)
Fetch number of holes in vector map.
int V1_open_new_ogr(struct Map_info *, const char *, int)
Prepare OGR datasource for creating new OGR layer (level 1)
const char * Vect_get_full_name(const struct Map_info *)
Get fully qualified name of vector map.
void Vect_spatial_index_destroy(struct spatial_index *)
Destroy existing spatial index.
int Vect_copy_tables(const struct Map_info *, struct Map_info *, int)
Copy attribute tables linked to vector map.
void Vect_spatial_index_add_item(struct spatial_index *, int, const struct bound_box *)
Add a new item to spatial index structure.
int Vect_list_append(struct ilist *, int)
Append new item to the end of list if not yet present.
List of bounding boxes with id.
int Vect_save_topo(struct Map_info *)
Save topology file for vector map.
int Vect_open_update2(struct Map_info *, const char *, const char *, const char *)
Open existing vector map for reading/writing.
const char * Vect_get_finfo_geometry_type(const struct Map_info *)
Get geometry type as string (relevant only for non-native formats)
int Vect_select_lines_by_polygon(struct Map_info *, struct line_pnts *, int, struct line_pnts **, int, struct ilist *)
Select lines by Polygon with optional isles.
int Vect_line_insert_point(struct line_pnts *, int, double, double, double)
Insert new point at index position and move all old points at that position and above up...
int Vect_open_fidx(struct Map_info *, struct Format_info_offset *)
Open feature index file.
int Vect_box_clip(double *, double *, double *, double *, const struct bound_box *)
Clip coordinates to box, if necessary, lines extending outside of a box.
struct cat_list * Vect_cats_set_constraint(struct Map_info *, int, char *, char *)
Set category constraints using 'where' or 'cats' option and layer number.
int Vect_line_alive(const struct Map_info *, int)
Check if feature is alive or dead (topological level required)
int Vect_build_partial(struct Map_info *, int)
Build partial topology for vector map.
int Vect_cats_in_constraint(struct line_cats *, int, struct cat_list *)
Check if categories match with category constraints.
int Vect_open_tmp_update(struct Map_info *, const char *, const char *)
Open existing temporary vector map for reading/writing.
void Vect_remove_bridges(struct Map_info *, struct Map_info *, int *, int *)
Remove bridges from vector map.
Structure that stores option information.
int V2_rewind_pg(struct Map_info *)
Rewind vector map (PostGIS layer) to cause reads to start at beginning on topological level (level 2)...
void Vect_graph_set_node_costs(dglGraph_s *, int, double)
Set node costs.
int V1_read_next_line_nat(struct Map_info *, struct line_pnts *, struct line_cats *)
Read next vector feature on non-topological level (level 1) - native format - internal use only...
const char * Vect_get_finfo_dsn_name(const struct Map_info *)
Get datasource name (relevant only for non-native formats)
const char * Vect_get_comment(const struct Map_info *)
Get comment or other info string from map header.
int Vect_find_island(struct Map_info *, double, double)
Find the nearest island.
off_t V2_write_line_pg(struct Map_info *, int, const struct line_pnts *, const struct line_cats *)
Writes feature on topological level (PostGIS interface)
int Vect_node_alive(const struct Map_info *, int)
Check if node is alive or dead (topological level required)
plus_t Vect_get_num_islands(const struct Map_info *)
Get number of islands in vector map.
int Vect_open_old(struct Map_info *, const char *, const char *)
Open existing vector map for reading.
int Vect_cat_list_to_array(const struct cat_list *, int **, int *)
Convert cat_list struct to ordered array of unique integers.
const char * Vect_get_finfo_format_info(const struct Map_info *)
Get format info as string (relevant only for non-native formats)
int Vect_read_header(struct Map_info *)
Read vector map header from map head file.
struct field_info * Vect_get_field2(const struct Map_info *, const char *)
Get information about link to database (by layer number or layer name)
int Vect_open_old2(struct Map_info *, const char *, const char *, const char *)
Open existing vector map for reading.
int Vect_net_ttb_shortest_path(struct Map_info *, int, int, int, int, int, struct ilist *, double *)
Find shortest path on network.
int Vect_remove_colors(const char *, const char *)
Remove color table of raster map.
int Vect_copy_table(const struct Map_info *, struct Map_info *, int, int, const char *, int)
Copy attribute table linked to vector map based on type.
int Vect_snap_line(struct Map_info *, struct ilist *, struct line_pnts *, double, int, int *, int *)
Snap a line to reference lines in Map with threshold.
struct Map_info * Vect_new_map_struct(void)
Creates and initializes Map_info structure.
int Vect_get_line_cat(const struct Map_info *, int, int)
Fetches FIRST category number for given vector line and field.
int Vect_overlay(struct Map_info *, int, struct ilist *, struct ilist *, struct Map_info *, int, struct ilist *, struct ilist *, int, struct Map_info *)
Overlay 2 vector maps and create new one.
int Vect_point_on_line(const struct line_pnts *, double, double *, double *, double *, double *, double *)
Find point on line in the specified distance.
const char * Vect_get_column_types(const struct Map_info *, int)
Fetches list of DB column types of vector map attribute table.
struct boxlist * Vect_new_boxlist(int)
Creates and initializes a struct boxlist.
int Vect_option_to_types(const struct Option *)
Get types from options.
int Vect_map_check_dblink(const struct Map_info *, int, const char *)
Check if DB connection exists in dblinks structure.
int Vect_set_person(struct Map_info *, const char *)
Set name of user who digitized the map in map header.
int V2_close_pg(struct Map_info *)
Close vector map (PostGIS layer) on topological level (write out fidx file)
int Vect_find_line_list(struct Map_info *, double, double, double, int, double, int, const struct ilist *, struct ilist *)
Find the nearest line(s).
void Vect_reset_updated(struct Map_info *)
Reset list of updated lines/nodes.
int Vect_cidx_get_num_unique_cats_by_index(const struct Map_info *, int)
Get number of unique categories for given layer index.
int Vect_box_overlap(const struct bound_box *, const struct bound_box *)
Tests for overlap of two boxes.
int Vect_get_map_box1(struct Map_info *, struct bound_box *)
Get bounding box of map on level 1 (all features in the map)
plus_t Vect_get_num_kernels(const struct Map_info *)
Fetch number of kernels in vector map.
int V1_open_new_pg(struct Map_info *, const char *, int)
Prepare PostGIS database for creating new feature table (level 1)
int Vect_get_scale(const struct Map_info *)
Get map scale from map header.
int Vect__write_head(const struct Map_info *)
Writes head information to text file (GV_HEAD_ELEMENT)
int Vect_read_next_line(const struct Map_info *, struct line_pnts *, struct line_cats *)
Read next vector feature.
int V1_open_old_ogr(struct Map_info *, int)
Open existing OGR layer on non-topological level.
int Vect_cidx_get_field_index(const struct Map_info *, int)
Get layer index for given layer number.
int Vect_sfa_is_line_simple(const struct line_pnts *, int, int)
Check if feature is simple.
int Vect_region_box(const struct Cell_head *, struct bound_box *)
Copy region window to bounding box.
int Vect_sidx_dump(const struct Map_info *, FILE *)
Dump spatial index to file.
void Vect_copy_map_dblinks(const struct Map_info *, struct Map_info *, int)
Copy DB links from input vector map to output vector map.
void Vect_destroy_line_struct(struct line_pnts *)
Frees all memory associated with a line_pnts structure, including the structure itself.
int Vect_net_shortest_path(struct Map_info *, int, int, struct ilist *, double *)
Find shortest path.
double Vect_get_area_area(const struct Map_info *, int)
Returns area of area without areas of isles.
void Vect_hist_rewind(struct Map_info *)
Rewind history file.
int Vect_get_updated_node(const struct Map_info *, int)
Get updated (modified) node by index.
plus_t Vect_get_num_volumes(const struct Map_info *)
Fetch number of volumes in vector map.
int Vect_get_area_points(const struct Map_info *, int, struct line_pnts *)
Returns polygon array of points (outer ring) of given area.
int Vect_read_ascii(FILE *, struct Map_info *)
Read data in GRASS ASCII vector format.
void Vect_write_ascii_head(FILE *, struct Map_info *)
Write data to GRASS ASCII vector format.
int Vect_set_organization(struct Map_info *, const char *)
Set organization string in map header.
int Vect_read_line(const struct Map_info *, struct line_pnts *, struct line_cats *, int)
Read vector feature (topological level required)
void Vect_set_updated(struct Map_info *, int)
Enable/disable maintanance of list of updated lines/nodes.
void Vect_destroy_map_struct(struct Map_info *)
Frees all memory associated with a Map_info structure, including the structure itself.
int Vect_coor_info(const struct Map_info *, struct Coor_info *)
Update Coor_info structure.
const char * Vect_get_name(const struct Map_info *)
Get name of vector map.
int Vect_boxlist_delete(struct boxlist *, int)
Remove a given value (item) from list.
int Vect_field_cat_del(struct line_cats *, int, int)
Delete field/cat from line_cats structure.
int Vect_save_fidx(struct Map_info *, struct Format_info_offset *)
Save feature index file for vector map.
int Vect_copy_table_by_cat_list(const struct Map_info *, struct Map_info *, int, int, const char *, int, const struct cat_list *)
Copy attribute table linked to vector map based on category list.
const char * Vect_get_mapset(const struct Map_info *)
Get name of mapset where vector map lives.
int Vect_level(const struct Map_info *)
Returns level that Map is opened at.
int Vect_set_zone(struct Map_info *, int)
Set projection zone in map header.
int Vect_net_ttb_shortest_path_coor(struct Map_info *, double, double, double, double, double, double, double, double, int, double *, struct line_pnts *, struct ilist *, struct ilist *, struct line_pnts *, struct line_pnts *, double *, double *)
Find shortest path on network with turntable between 2 points given by coordinates.
int V1_close_pg(struct Map_info *)
Close vector map (PostGIS layer) on level 1.
int Vect_break_lines_list(struct Map_info *, struct ilist *, struct ilist *, int, struct Map_info *)
Break selected lines in vector map at each intersection.
int Vect_list_delete_list(struct ilist *, const struct ilist *)
Delete list from existing list.
int Vect_get_line_areas(const struct Map_info *, int, int *, int *)
Get area id on the left and right side of the boundary.
int Vect_line_check_intersection(struct line_pnts *, struct line_pnts *, int)
Check if 2 lines intersect.
int Vect_get_area_cat(const struct Map_info *, int, int)
Find FIRST category of given field and area.
int Vect_get_num_updated_lines(const struct Map_info *)
Get number of updated features.
int Vect_cat_get(const struct line_cats *, int, int *)
Get first found category of given field.
int Vect_line_prune_thresh(struct line_pnts *, double)
Remove points in threshold.
int Vect_array_to_cat_list(const int *, int, struct cat_list *)
Convert ordered array of integers to cat_list structure.
void Vect_reset_line(struct line_pnts *)
Reset line.
int Vect_line_delete_point(struct line_pnts *, int)
Delete point at given index and move all points above down.
int Vect_set_varray_from_db(const struct Map_info *, int, const char *, int, int, struct varray *)
Set values in 'varray' to 'value' from DB (where statement)
int Vect_tin_get_z(struct Map_info *, double, double, double *, double *, double *)
Calculates z coordinate for point from TIN.
int Vect_set_scale(struct Map_info *, int)
Set map scale in map header.
int Vect_select_areas_by_polygon(struct Map_info *, struct line_pnts *, int, struct line_pnts **, struct ilist *)
Select areas by Polygon with optional isles.
int Vect_point_in_box_2d(double, double, const struct bound_box *)
Tests if point is in 2D box.
void Vect_spatial_index_del_item(struct spatial_index *, int, const struct bound_box *)
Delete item from spatial index structure.
int Vect_get_line_type(const struct Map_info *, int)
Get line type.
int Vect_cat_set(struct line_cats *, int, int)
Add new field/cat to category structure if doesn't exist yet.
SF_FeatureType
Simple feature types.
const char * Vect_get_person(const struct Map_info *)
Get user name string who digitized the map from map header.
int V2_read_next_line_ogr(struct Map_info *, struct line_pnts *, struct line_cats *)
Read next feature from OGR layer on topological level.
void Vect__build_downgrade(struct Map_info *, int)
Downgrade build level (for internal use only)
int Vect__read_head(struct Map_info *)
Reads head information from text file (GV_HEAD_ELEMENT) - for internal use only.
int Vect_cidx_open(struct Map_info *, int)
Read category index from cidx file if exists.
int V2_delete_line_sfa(struct Map_info *, off_t)
Deletes feature on level 2 (OGR/PostGIS interface)