|
GRASS 8 Programmer's Manual 8.6.0dev(2026)-ddeab64dbf
|
Vector library - OGC Simple Features Access. More...
#include <stdio.h>#include <grass/vector.h>#include <grass/glocale.h>#include <ogr_api.h>#include "pg_local_proto.h"
Go to the source code of this file.
Functions | |
| SF_FeatureType | Vect_sfa_get_line_type (const struct line_pnts *Points, int type, int with_z) |
| Get SF type of given vector feature. | |
| int | Vect_sfa_get_type (SF_FeatureType sftype) |
| Get relevant GV type. | |
| int | Vect_sfa_check_line_type (const struct line_pnts *Points, int type, SF_FeatureType sftype, int with_z) |
| Check SF type. | |
| int | Vect_sfa_line_dimension (int type) |
| Get geometry dimension. | |
| char * | Vect_sfa_line_geometry_type (const struct line_pnts *Points, int type) |
| Get geometry type (string) | |
| int | Vect_sfa_line_astext (const struct line_pnts *Points, int type, int with_z, int precision, FILE *file) |
| Export geometry to Well-Known Text. | |
| int | Vect_sfa_is_line_simple (const struct line_pnts *Points, int type, int with_z) |
| Check if feature is simple. | |
| int | Vect_sfa_is_line_closed (const struct line_pnts *Points, int type, int with_z) |
| Check if feature is closed. | |
| int | Vect_sfa_get_num_features (struct Map_info *Map) |
| Get number of simple features. | |
Vector library - OGC Simple Features Access.
Higher level functions for reading/writing/manipulating vectors.
Note: In progress! Currently on GV_POINT, GV_LINE, GV_BOUNDARY are supported.
Reference: http://www.opengeospatial.org/standards/sfa
(C) 2009, 2011-2013 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 simple_features.c.
| int Vect_sfa_check_line_type | ( | const struct line_pnts * | Points, |
| int | type, | ||
| SF_FeatureType | sftype, | ||
| int | with_z | ||
| ) |
Check SF type.
E.g. if type is GV_LINE with two or more segments and the start node is identical with the end node, and sftype is SF_LINEARRING, functions returns 1, otherwise 0.
| Points | pointer to line_pnts structure |
| type | feature type (GV_POINT, GV_LINE, ...) |
| sftype | SF type to be checked (SF_POINT, SF_LINE, ...) |
| with_z | non-zero value for 3D data |
Definition at line 111 of file simple_features.c.
Get SF type of given vector feature.
List of supported feature types:
| Points | pointer to line_pnts structure |
| type | feature type (see supported types above) |
| with_z | WITH_Z for 3D data |
Definition at line 62 of file simple_features.c.
Referenced by Vect_sfa_line_astext(), and Vect_sfa_line_geometry_type().
Get number of simple features.
For native format or PostGIS Topology returns -1
| Map | vector map |
Definition at line 298 of file simple_features.c.
References _, DB_SQL_MAX, G_fatal_error(), G_free(), G_warning(), GV_FORMAT_OGR, GV_FORMAT_OGR_DIRECT, GV_FORMAT_POSTGIS, TRUE, Vect__execute_get_value_pg(), and Vect_get_full_name().
| int Vect_sfa_get_type | ( | SF_FeatureType | sftype | ) |
Get relevant GV type.
| sftype | SF geometry type (SF_POINT, SF_LINESTRING, ...) |
Definition at line 76 of file simple_features.c.
References GV_BOUNDARY, GV_LINE, GV_POINT, SF_LINEARRING, SF_LINESTRING, SF_LINESTRING25D, SF_POINT, SF_POINT25D, SF_POLYGON, and SF_POLYGON25D.
Check if feature is closed.
| Points | pointer to line_pnts structure |
| type | feature type (GV_LINE or GV_BOUNDARY) |
| with_z |
Definition at line 269 of file simple_features.c.
References GV_LINES, Vect_get_num_line_points(), line_pnts::x, line_pnts::y, and line_pnts::z.
Check if feature is simple.
| Points | pointer to line_pnts structure (unused) |
| type | feature type (GV_POINT, GV_LINE, ...) (unused) |
| with_z | (unused) |
Definition at line 245 of file simple_features.c.
| int Vect_sfa_line_astext | ( | const struct line_pnts * | Points, |
| int | type, | ||
| int | with_z, | ||
| int | precision, | ||
| FILE * | file | ||
| ) |
Export geometry to Well-Known Text.
| Points | pointer to line_pnts structure | |
| type | feature type | |
| with_z | non-zero value for 3D data | |
| precision | floating number precision | |
| [out] | file | file where to write the output |
Definition at line 184 of file simple_features.c.
References _, file, G_warning(), line_pnts::n_points, SF_LINEARRING, SF_LINESTRING, SF_POINT, SF_POLYGON, and Vect_sfa_get_line_type().
Referenced by Vect_write_ascii().
Get geometry dimension.
| type | feature type (GV_POINT, GV_LINE, ...) |
Definition at line 127 of file simple_features.c.
References GV_BOUNDARY, GV_LINE, and GV_POINT.
Get geometry type (string)
Supported types:
Note: Allocated string should be freed by G_free().
| Points | pointer to line_pnts structure (feature geometry) |
| type | feature type (see supported types above) |
Definition at line 156 of file simple_features.c.
References G_store(), NULL, SF_LINEARRING, SF_LINESTRING, SF_POINT, SF_POLYGON, and Vect_sfa_get_line_type().