23 #include "local_proto.h" 34 fprintf(stdout,
"\nSelected information from dig header\n");
85 if (head_fp ==
NULL) {
86 G_warning(
_(
"Unable to create header file for vector map <%s>"),
128 if (head_fp ==
NULL) {
129 G_warning(
_(
"Unable to open header file of vector <%s>"),
134 while (
G_getl2(buff, 2000, head_fp)) {
136 if (!(ptr = strchr(buff,
':'))) {
137 G_warning(
_(
"Corrupted row in head: %s"), buff);
145 if (strncmp(buff,
"ORGANIZATION:",
sizeof(
char) * 13) == 0)
147 else if (strncmp(buff,
"DIGIT DATE:",
sizeof(
char) * 11) == 0)
149 else if (strncmp(buff,
"DIGIT NAME:",
sizeof(
char) * 11) == 0)
151 else if (strncmp(buff,
"MAP NAME:",
sizeof(
char) * 9) == 0)
153 else if (strncmp(buff,
"MAP DATE:",
sizeof(
char) * 9) == 0)
155 else if (strncmp(buff,
"MAP SCALE:",
sizeof(
char) * 10) == 0)
157 else if (strncmp(buff,
"OTHER INFO:",
sizeof(
char) * 11) == 0)
159 else if (strncmp(buff,
"PROJ:",
sizeof(
char) * 5) == 0)
161 else if (strncmp(buff,
"ZONE:",
sizeof(
char) * 5) == 0 ||
162 strncmp(buff,
"UTM ZONE:",
sizeof(
char) * 9) == 0)
164 else if (strncmp(buff,
"WEST EDGE:",
sizeof(
char) * 10) == 0) {
166 else if (strncmp(buff,
"EAST EDGE:",
sizeof(
char) * 10) == 0) {
168 else if (strncmp(buff,
"SOUTH EDGE:",
sizeof(
char) * 11) == 0) {
170 else if (strncmp(buff,
"NORTH EDGE:",
sizeof(
char) * 11) == 0) {
172 else if (strncmp(buff,
"MAP THRESH:",
sizeof(
char) * 11) == 0)
175 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);
551 G_debug(1,
"Vect_get_proj_name(): " 552 "Vect_get_proj() returned an invalid result (%d)", n);
556 strcpy(name,
_(
"Unknown projection"));
570 G_debug(1,
"Vect_set_thresh(): thresh = %f", thresh);
int G_getl2(char *, int, FILE *)
Gets a line of text from a file of any pedigree.
char * name
Map name (for 4.0)
void Vect__init_head(struct Map_info *)
Initialize Map_info head structure (dig_head)
int G_zone(void)
Query cartographic zone.
void G_free(void *)
Free allocated memory.
#define GV_HEAD_ELEMENT
Native format, header information.
char * source_date
Source date.
struct Format_info fInfo
Format info for non-native formats.
#define PROJECTION_XY
Projection code - XY coordinate system (unreferenced data)
int plani_zone
Zone (UTM only)
#define PROJECTION_UTM
Projection code - UTM.
int with_z
2D/3D vector data
FILE * G_fopen_new(const char *, const char *)
Open a new database file.
#define PROJECTION_OTHER
Projection code - other projection (other then noted above)
const char * G_projection_name(int)
Get projection name.
#define GV_FORMAT_OGR_DIRECT
OGR format (direct access)
long orig_scale
Original scale.
#define PROJECTION_LL
Projection code - Latitude-Longitude.
FILE * G_fopen_old(const char *, const char *, const char *)
Open a database file for reading.
char * mapset
Mapset name.
struct dig_head head
Header info.
const char * G_database_projection_name(void)
Query cartographic projection for the current location.
char * organization
Organization name.
double digit_thresh
Threshold for digitization.
void G_warning(const char *,...) __attribute__((format(printf
int format
Map format (native, ogr, postgis)
char * G_store(const char *)
Copy string to allocated memory.
char * Vect__get_path(char *path, const struct Map_info *Map)
Get map directory name (internal use only)
char * user_name
User name.
int G_debug(int, const char *,...) __attribute__((format(printf