17
17
int what(double east, double north, double maxdist, int width,
18
int mwidth, int topo, int showextra)
18
int mwidth, int topo, int showextra, int script)
21
21
char east_buf[40], north_buf[40];
54
54
line = Vect_find_line(&Map[i], east, north, 0.0,
55
GV_LINE | GV_BOUNDARY | GV_FACE, maxdist, 0,
55
GV_LINE | GV_BOUNDARY | GV_FACE, maxdist, 0, 0);
67
66
G_format_easting(east, east_buf, G_projection());
68
67
G_format_northing(north, north_buf, G_projection());
69
68
if (line + area > 0 || G_verbose() >= G_verbose_std()) {
70
fprintf(stdout, "\nEast: %s\nNorth: %s\n", east_buf,
70
fprintf(stdout, "East=%s\nNorth=%s\n", east_buf,
74
fprintf(stdout, "\nEast: %s\nNorth: %s\n", east_buf,
73
78
fprintf(stderr, "\nEast: %s\nNorth: %s\n", east_buf,
83
88
if (line + area > 0 || G_verbose() >= G_verbose_std()) {
84
/* fprintf(stdout, "Map: %*s \nMapset: %-*s\n", width, Map[i].name, mwidth, Map[i].mapset); */
85
fprintf(stdout, "\nMap: %s \nMapset: %s\n", Map[i].name,
90
fprintf(stdout, "Map=%s\nMapset=%s\n", Map[i].name,
94
fprintf(stdout, "\nMap: %s \nMapset: %s\n", Map[i].name,
88
/* fprintf(stderr, "Map: %*s \nMapset: %-*s\n", width, Map[i].name, mwidth, Map[i].mapset); */
89
98
fprintf(stderr, "\nMap: %s \nMapset: %s\n", Map[i].name,
137
146
Vect_get_line_areas(&(Map[i]), line, &left, &right);
138
fprintf(stdout, "Looking for features within: %f\n",
141
_("Id: %d\nType: %s\nLeft: %d\nRight: %d\n"),
142
line, buf, left, right);
148
fprintf(stdout, "Feature_max_distance=%f\n", maxdist);
150
"Id=%d\nType=%s\nLeft=%d\nRight=%d\n",
151
line, buf, left, right);
154
fprintf(stdout, "Looking for features within: %f\n",
157
_("Id: %d\nType: %s\nLeft: %d\nRight: %d\n"),
158
line, buf, left, right);
143
160
if (type & GV_LINES) {
145
162
fprintf(stdout, _("Length: %f\n"), l);
147
164
else { /* points */
149
fprintf(stdout, "\n");
167
fprintf(stdout, "\n");
152
170
Vect_get_line_nodes(&(Map[i]), line, &node[0], &node[1]);
157
175
nnlines = Vect_get_node_n_lines(&(Map[i]), node[n]);
159
177
Vect_get_node_coor(&(Map[i]), node[n], &nx, &ny, &nz);
161
_("Node[%d]: %d\nNumber of lines: %d\nCoordinates: %.6f, %.6f, %.6f\n"),
162
n, node[n], nnlines, nx, ny, nz);
180
_("Node[%d]=%d\nNumber_lines=%d\nCoordinates=%.6f,%.6f,%.6f\n"),
181
n, node[n], nnlines, nx, ny, nz);
185
_("Node[%d]: %d\nNumber of lines: %d\nCoordinates: %.6f, %.6f, %.6f\n"),
186
n, node[n], nnlines, nx, ny, nz);
164
189
for (nli = 0; nli < nnlines; nli++) {
166
191
Vect_get_node_line(&(Map[i]), node[n], nli);
168
193
Vect_get_node_line_angle(&(Map[i]), node[n], nli);
169
fprintf(stdout, _("Id: %5d\nAngle: %.8f\n"),
195
fprintf(stdout, "Id=%5d\nAngle=%.8f\n",
199
fprintf(stdout, _("Id: %5d\nAngle: %.8f\n"),
176
fprintf(stdout, _("Type: %s"), buf);
177
fprintf(stdout, _("Id: %d\n"), line);
179
fprintf(stdout, _("Length: %f\n"), l);
208
fprintf(stdout, "Type=%s\n", buf);
209
fprintf(stdout, "Id=%d\n", line);
211
fprintf(stdout, "Length=%f\n", l);
214
fprintf(stdout, _("Type: %s"), buf);
215
fprintf(stdout, _("Id: %d\n"), line);
217
fprintf(stdout, _("Length: %f\n"), l);
187
226
if (type & GV_POINTS) {
188
fprintf(stdout, _("Point height: %f\n"), Points->z[0]);
228
fprintf(stdout, "Point_height=%f\n", Points->z[0]);
231
fprintf(stdout, _("Point height: %f\n"),
190
235
else if (type & GV_LINES) {
191
236
min = max = Points->z[0];
196
241
max = Points->z[j];
198
243
if (min == max) {
199
fprintf(stdout, _("Line height: %f\n"), min);
245
fprintf(stdout, "Line_height=%f\n", min);
248
fprintf(stdout, _("Line height: %f\n"), min);
203
_("Line height min: %f\nLine height max: %f\n"),
254
"Line_height_min=%f\nLine_height_max=%f\n",
259
_("Line height min: %f\nLine height max: %f\n"),
207
264
} /* if height */
211
268
if (Map[i].head.with_z && getz) {
212
fprintf(stdout, _("Type: Area\nArea height: %f\n"),
270
fprintf(stdout, "Type=Area\nArea_height=%f\n", z);
273
fprintf(stdout, _("Type: Area\nArea height: %f\n"), z);
216
fprintf(stdout, _("Type: Area\n"));
278
fprintf(stdout, "Type=Area\n");
281
fprintf(stdout, _("Type: Area\n"));
229
295
int nisles, isleidx, isle, isle_area;
231
297
nisles = Vect_get_area_num_isles(&Map[i], area);
232
fprintf(stdout, _("Area: %d\nNumber of isles: %d\n"), area,
299
fprintf(stdout, "Area=%d\nNumber_isles=%d\n", area,
303
fprintf(stdout, _("Area: %d\nNumber of isles: %d\n"),
235
307
for (isleidx = 0; isleidx < nisles; isleidx++) {
236
308
isle = Vect_get_area_isle(&Map[i], area, isleidx);
237
fprintf(stdout, _("Isle[%d]: %d\n"), isleidx, isle);
310
fprintf(stdout, "Isle[%d]=%d\n", isleidx, isle);
313
fprintf(stdout, _("Isle[%d]: %d\n"), isleidx, isle);
240
317
isle = Vect_find_island(&Map[i], east, north);
243
320
isle_area = Vect_get_isle_area(&Map[i], isle);
244
fprintf(stdout, _("Island: %d In area: %d\n"), isle,
322
fprintf(stdout, "Island=%d\nIsland_area=%d\n", isle,
326
fprintf(stdout, _("Island: %d In area: %d\n"), isle,
249
fprintf(stdout, _("Sq Meters: %.3f\nHectares: %.3f\n"),
250
sq_meters, hectares);
251
fprintf(stdout, _("Acres: %.3f\nSq Miles: %.4f\n"),
333
fprintf(stdout, "Sq_Meters=%.3f\nHectares=%.3f\n",
334
sq_meters, hectares);
335
fprintf(stdout, "Acres=%.3f\nSq_Miles=%.4f\n",
339
fprintf(stdout, _("Sq Meters: %.3f\nHectares: %.3f\n"),
340
sq_meters, hectares);
341
fprintf(stdout, _("Acres: %.3f\nSq Miles: %.4f\n"),
255
346
_("Sq Meters: %.3f\nHectares: %.3f\n"),
269
360
if (Cats->n_cats > 0) {
362
char *formbuf1, *formbuf2;
272
364
for (j = 0; j < Cats->n_cats; j++) {
273
365
G_debug(2, "field = %d category = %d\n", Cats->field[j],
275
fprintf(stdout, _("Layer: %d\nCategory: %d\n"),
276
Cats->field[j], Cats->cat[j]);
368
fprintf(stdout, "Layer=%d\nCategory=%d\n", Cats->field[j],
372
fprintf(stdout, _("Layer: %d\nCategory: %d\n"),
373
Cats->field[j], Cats->cat[j]);
277
375
Fi = Vect_get_field(&(Map[i]), Cats->field[j]);
278
376
if (Fi != NULL && showextra) {
279
377
int format = F_TXT, edit_mode = F_VIEW;
282
_("\nDriver: %s\nDatabase: %s\nTable: %s\nKey column: %s\n"),
283
Fi->driver, Fi->database, Fi->table, Fi->key);
284
F_generate(Fi->driver, Fi->database, Fi->table, Fi->key,
285
Cats->cat[j], NULL, NULL, edit_mode, format,
287
fprintf(stdout, "%s", form);
381
"Driver=%s\nDatabase=%s\nTable=%s\nKey_column=%s\n",
382
Fi->driver, Fi->database, Fi->table, Fi->key);
386
_("\nDriver: %s\nDatabase: %s\nTable: %s\nKey column: %s\n"),
387
Fi->driver, Fi->database, Fi->table, Fi->key);
389
F_generate(Fi->driver, Fi->database, Fi->table,
390
Fi->key, Cats->cat[j], NULL, NULL,
391
edit_mode, format, &form);
394
formbuf1 = G_str_replace(form, " : ", "=");
395
formbuf2 = G_str_replace(formbuf1, " ", "_");
396
fprintf(stdout, "%s", formbuf2);
401
fprintf(stdout, "%s", form);