24 #include "local_proto.h"
35 fprintf(stdout,
"\nSelected information from dig header\n");
86 if (head_fp ==
NULL) {
88 G_warning(
_(
"Unable to create header file for vector map <%s>"),
132 if (head_fp ==
NULL) {
134 G_warning(
_(
"Unable to open header file of vector <%s>"), map_name);
139 while (
G_getl2(buff, 2000, head_fp)) {
141 if (!(ptr = strchr(buff,
':'))) {
142 G_warning(
_(
"Corrupted row in head: %s"), buff);
150 if (strncmp(buff,
"ORGANIZATION:",
sizeof(
char) * 13) == 0)
152 else if (strncmp(buff,
"DIGIT DATE:",
sizeof(
char) * 11) == 0)
154 else if (strncmp(buff,
"DIGIT NAME:",
sizeof(
char) * 11) == 0)
156 else if (strncmp(buff,
"MAP NAME:",
sizeof(
char) * 9) == 0)
158 else if (strncmp(buff,
"MAP DATE:",
sizeof(
char) * 9) == 0)
160 else if (strncmp(buff,
"MAP SCALE:",
sizeof(
char) * 10) == 0)
162 else if (strncmp(buff,
"OTHER INFO:",
sizeof(
char) * 11) == 0)
164 else if (strncmp(buff,
"PROJ:",
sizeof(
char) * 5) == 0)
166 else if (strncmp(buff,
"ZONE:",
sizeof(
char) * 5) == 0 ||
167 strncmp(buff,
"UTM ZONE:",
sizeof(
char) * 9) == 0)
169 else if (strncmp(buff,
"WEST EDGE:",
sizeof(
char) * 10) == 0) {
171 else if (strncmp(buff,
"EAST EDGE:",
sizeof(
char) * 10) == 0) {
173 else if (strncmp(buff,
"SOUTH EDGE:",
sizeof(
char) * 11) == 0) {
175 else if (strncmp(buff,
"NORTH EDGE:",
sizeof(
char) * 11) == 0) {
177 else if (strncmp(buff,
"MAP THRESH:",
sizeof(
char) * 11) == 0)
180 G_warning(
_(
"Unknown keyword '%s' in vector head"), buff);
240 len = strlen(Map->
name) + strlen(Map->
mapset) + 2;
242 if (strlen(Map->
mapset) > 0) {
243 snprintf(ptr, len,
"%s@%s", Map->
name, Map->
mapset);
246 snprintf(ptr, len,
"%s", Map->
name);
560 "Vect_get_proj_name(): "
561 "Vect_get_proj() returned an invalid result (%d)",
580 G_debug(1,
"Vect_set_thresh(): thresh = %f", thresh);
FILE * G_fopen_old(const char *, const char *, const char *)
Open a database file for reading.
int G_getl2(char *, int, FILE *)
Gets a line of text from a file of any pedigree.
void G_free(void *)
Free allocated memory.
const char * G_database_projection_name(void)
Query cartographic projection for the current location.
void G_warning(const char *,...) __attribute__((format(printf
const char * G_projection_name(int)
Get projection name.
int G_zone(void)
Query cartographic zone.
int G_debug(int, const char *,...) __attribute__((format(printf
char * G_store(const char *)
Copy string to allocated memory.
FILE * G_fopen_new(const char *, const char *)
Open a new database file.
void Vect__init_head(struct Map_info *)
Initialize Map_info head structure (dig_head)
#define GV_FORMAT_OGR_DIRECT
OGR format (direct access)
#define GV_HEAD_ELEMENT
Native format, header information.
#define PROJECTION_OTHER
Projection code - other projection (other then noted above)
#define PROJECTION_XY
Projection code - XY coordinate system (unreferenced data)
#define PROJECTION_UTM
Projection code - UTM.
#define PROJECTION_LL
Projection code - Latitude-Longitude.
#define UNUSED
A macro for an attribute, if attached to a variable, indicating that the variable is not used.
char * mapset
Mapset name.
struct dig_head head
Header info.
char * name
Map name (for 4.0)
int format
Map format (native, ogr, postgis)
struct Format_info fInfo
Format info for non-native formats.
long orig_scale
Original scale.
int plani_zone
Zone (UTM only)
double digit_thresh
Threshold for digitization.
char * organization
Organization name.
int with_z
2D/3D vector data
char * user_name
User name.
char * source_date
Source date.
char * Vect__get_path(char *path, struct Map_info *Map)
Get map directory name (internal use only)