[GRASS-SVN] r50462 - grass/trunk/lib/vector/Vlib
svn_grass at osgeo.org
svn_grass at osgeo.org
Thu Jan 26 02:44:41 EST 2012
Author: hamish
Date: 2012-01-25 23:44:40 -0800 (Wed, 25 Jan 2012)
New Revision: 50462
Modified:
grass/trunk/lib/vector/Vlib/header.c
Log:
write out PROJ code to vector/head if known; move obvious handling of PROJECTION_OTHER by Vect_get_proj_name()
Modified: grass/trunk/lib/vector/Vlib/header.c
===================================================================
--- grass/trunk/lib/vector/Vlib/header.c 2012-01-26 06:30:56 UTC (rev 50461)
+++ grass/trunk/lib/vector/Vlib/header.c 2012-01-26 07:44:40 UTC (rev 50462)
@@ -96,6 +96,8 @@
fprintf(head_fp, "MAP DATE: %s\n", Vect_get_map_date(Map));
fprintf(head_fp, "MAP SCALE: %d\n", Vect_get_scale(Map));
fprintf(head_fp, "OTHER INFO: %s\n", Vect_get_comment(Map));
+ if (Vect_get_proj(Map) > 0)
+ fprintf(head_fp, "PROJ: %d\n", Vect_get_proj(Map));
fprintf(head_fp, "ZONE: %d\n", Vect_get_zone(Map));
fprintf(head_fp, "MAP THRESH: %f\n", Vect_get_thresh(Map));
@@ -615,18 +617,18 @@
case PROJECTION_LL:
case PROJECTION_SP:
return G__projection_name(n);
+ case PROJECTION_OTHER:
+ /* this won't protect against differing "other" projections, so
+ better to just include P_OTHER in the above list so we return the
+ strictly more correct, but less nice, string: "Other projection" ? */
+ return G_database_projection_name();
default:
G_debug(1, "Vect_get_proj_name(): "
"Vect_get_proj() returned an invalid result (%d)", n);
break;
}
- /* Vect_get_proj() didn't return a useful result,
- fallback to G_database_projection_name() */
- /* (is this behavior desirable?) */
- if (!lookup(PROJECTION_FILE, "name", name, sizeof(name)))
- strcpy(name, _("Unknown projection"));
-
+ strcpy(name, _("Unknown projection"));
return G_store(name);
}
More information about the grass-commit
mailing list