24 #include "local_proto.h"
35 fprintf(stdout,
"\nSelected information from dig header\n");
86 if (head_fp ==
NULL) {
87 G_warning(
_(
"Unable to create header file for vector map <%s>"),
130 if (head_fp ==
NULL) {
131 G_warning(
_(
"Unable to open header file of vector <%s>"),
136 while (
G_getl2(buff, 2000, head_fp)) {
138 if (!(ptr = strchr(buff,
':'))) {
139 G_warning(
_(
"Corrupted row in head: %s"), buff);
147 if (strncmp(buff,
"ORGANIZATION:",
sizeof(
char) * 13) == 0)
149 else if (strncmp(buff,
"DIGIT DATE:",
sizeof(
char) * 11) == 0)
151 else if (strncmp(buff,
"DIGIT NAME:",
sizeof(
char) * 11) == 0)
153 else if (strncmp(buff,
"MAP NAME:",
sizeof(
char) * 9) == 0)
155 else if (strncmp(buff,
"MAP DATE:",
sizeof(
char) * 9) == 0)
157 else if (strncmp(buff,
"MAP SCALE:",
sizeof(
char) * 10) == 0)
159 else if (strncmp(buff,
"OTHER INFO:",
sizeof(
char) * 11) == 0)
161 else if (strncmp(buff,
"PROJ:",
sizeof(
char) * 5) == 0)
163 else if (strncmp(buff,
"ZONE:",
sizeof(
char) * 5) == 0 ||
164 strncmp(buff,
"UTM ZONE:",
sizeof(
char) * 9) == 0)
166 else if (strncmp(buff,
"WEST EDGE:",
sizeof(
char) * 10) == 0) {
168 else if (strncmp(buff,
"EAST EDGE:",
sizeof(
char) * 10) == 0) {
170 else if (strncmp(buff,
"SOUTH EDGE:",
sizeof(
char) * 11) == 0) {
172 else if (strncmp(buff,
"NORTH EDGE:",
sizeof(
char) * 11) == 0) {
174 else if (strncmp(buff,
"MAP THRESH:",
sizeof(
char) * 11) == 0)
177 G_warning(
_(
"Unknown keyword '%s' in vector head"), buff);
235 if (strlen(Map->
mapset) > 0) {
236 sprintf(ptr,
"%s@%s", Map->
name, Map->
mapset);
239 sprintf(ptr,
"%s", Map->
name);
553 "Vect_get_proj_name(): "
554 "Vect_get_proj() returned an invalid result (%d)",
573 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)