[GRASS-SVN] r35934 - grass-addons/vector/v.in.gshhs
svn_grass at osgeo.org
svn_grass at osgeo.org
Thu Feb 19 04:21:19 EST 2009
Author: hamish
Date: 2009-02-19 04:21:18 -0500 (Thu, 19 Feb 2009)
New Revision: 35934
Modified:
grass-addons/vector/v.in.gshhs/description.html
grass-addons/vector/v.in.gshhs/main.c
Log:
i18n; whitespace
Modified: grass-addons/vector/v.in.gshhs/description.html
===================================================================
--- grass-addons/vector/v.in.gshhs/description.html 2009-02-19 08:37:40 UTC (rev 35933)
+++ grass-addons/vector/v.in.gshhs/description.html 2009-02-19 09:21:18 UTC (rev 35934)
@@ -2,12 +2,15 @@
<em>v.in.gshhs</em> imports GSHHS shorelines as available on
<a href="http://www.soest.hawaii.edu/wessel/gshhs/">http://www.soest.hawaii.edu/wessel/gshhs/</a>
+
<p>
GSHHS shorelines are in latlon but can be imported to any location with
any projection apart from unreferenced XY projection. Reprojection is
done on the fly during import.
+
<p>
Shorelines are imported as lines, not boundaries.
+
<p>
The categories in layer 1 refer to the type of shoreline: 1 = land,
2 = lake, 3 = island in lake, 4 = pond in island in lake. The field
@@ -16,14 +19,18 @@
of each imported line. Each line has as category value the GSHHS ID in
layer 2, that may be useful for further processing. An attribute table
for layer 2 is not created.
+
<p>
The -r flag restricts the import to the current region, otherwise the
full dataset is imported. With the -r flag, any line that falls into or
overlaps with the current region is imported. Lines are not cropped.
+
<h2>NOTES</h2>
+
The GSHHS shorelines are in files named <tt>gshhs_[f|h|i|l|c].b</tt> where
the letter in brackets indicates the resolution.
+
<p>
The 5 available resolutions are:
<ul>
@@ -71,5 +78,6 @@
The gshhstograss tool was written by Simon Cox and Paul Wessel.<br>
The original version of v.in.gshhs was written by Bob Covill based on gshhstograss.<br>
Modifications and updates by Markus Neteler and Markus Metz.
+
<p>
<i>Last changed: $Date$</i>
Modified: grass-addons/vector/v.in.gshhs/main.c
===================================================================
--- grass-addons/vector/v.in.gshhs/main.c 2009-02-19 08:37:40 UTC (rev 35933)
+++ grass-addons/vector/v.in.gshhs/main.c 2009-02-19 09:21:18 UTC (rev 35934)
@@ -32,6 +32,7 @@
#include <grass/Vect.h>
#include <grass/gprojects.h>
#include <grass/glocale.h>
+
/* updating to a newer GSHHS version can be as easy as replacing gshhs.h
* if not too many changes were introduced */
#include "gshhs.h"
@@ -88,8 +89,9 @@
/* Set description */
module = G_define_module();
- module->description = ""
- "Imports Global Self-consistent Hierarchical High-resolution Shoreline (GSHHS) vector data";
+ module->description =
+ _("Imports Global Self-consistent Hierarchical High-resolution "
+ "Shoreline (GSHHS) vector data.");
parm.input = G_define_option();
parm.input->key = "input";
@@ -97,17 +99,17 @@
parm.input->required = YES;
parm.input->gisprompt = "old_file,file,gshhs";
parm.input->description =
- "Name of GSHHS shoreline file: gshhs_[f|h|i|l|c].b";
+ _("Name of GSHHS shoreline file: gshhs_[f|h|i|l|c].b");
parm.output = G_define_standard_option(G_OPT_V_OUTPUT);
flag.r = G_define_flag();
flag.r->key = 'r';
- flag.r->description = "Limit import to the current region";
+ flag.r->description = _("Limit import to the current region");
flag.topo = G_define_flag();
flag.topo->key = 't';
- flag.topo->description = "Do not build topology for output vector";
+ flag.topo->description = _("Do not build topology for output vector");
/* Importing as boundary causes problems with subregions, incorrect boundaries */
/* flag.a = G_define_flag();
@@ -119,6 +121,7 @@
if (G_parser(argc, argv))
exit(EXIT_FAILURE);
+
/* get parameters */
dataname = parm.input->answer;
outname = parm.output->answer;
@@ -159,7 +162,7 @@
info_in.meters = 1.;
sprintf(info_in.proj, "ll");
if ((info_in.pj = pj_latlong_from_proj(info_out.pj)) == NULL)
- G_fatal_error("Unable to set up lat/long projection parameters");
+ G_fatal_error(_("Unable to set up lat/long projection parameters"));
if (flag.r->answer) {
/* get coordinates from current region */
@@ -175,32 +178,32 @@
lon_nw = minx;
lat_nw = maxy;
if (pj_do_proj(&lon_nw, &lat_nw, &info_out, &info_in) < 0) {
- G_fatal_error
- ("Error in coordinate transformation for north west corner");
+ G_fatal_error(
+ _("Error in coordinate transformation for north-west corner"));
}
/* NE */
lon_ne = maxx;
lat_ne = maxy;
if (pj_do_proj(&lon_ne, &lat_ne, &info_out, &info_in) < 0) {
- G_fatal_error
- ("Error in coordinate transformation for north east corner");
+ G_fatal_error(
+ _("Error in coordinate transformation for north-east corner"));
}
/* SE */
lon_se = maxx;
lat_se = miny;
if (pj_do_proj(&lon_se, &lat_se, &info_out, &info_in) < 0) {
- G_fatal_error
- ("Error in coordinate transformation for south eest corner");
+ G_fatal_error(
+ _("Error in coordinate transformation for south-east corner"));
}
/* SW */
lon_sw = minx;
lat_sw = miny;
if (pj_do_proj(&lon_sw, &lat_sw, &info_out, &info_in) < 0) {
- G_fatal_error
- ("Error in coordinate transformation for south west corner");
+ G_fatal_error(
+ _("Error in coordinate transformation for south-west corner"));
}
/* get north max */
@@ -237,7 +240,7 @@
while (minx < -180.0)
minx += 360.0;
- G_message(_("Using lat/lon bounds N=%f S=%f E=%f W=%f\n"), maxy, miny,
+ G_message(_("Using lat/lon bounds N=%f S=%f E=%f W=%f"), maxy, miny,
maxx, minx);
if (maxx < minx)
@@ -245,12 +248,12 @@
/* open GSHHS shoreline for reading */
if ((fp = fopen(dataname, "rb")) == NULL) {
- G_fatal_error(_("Could not find file %s."), dataname);
+ G_fatal_error(_("Could not find file <%s>"), dataname);
}
/* Open new vector */
if (0 > Vect_open_new(&VectMap, outname, 0)) {
- G_fatal_error(_("Cannot open new vector %s"), outname);
+ G_fatal_error(_("Cannot open new vector map <%s>"), outname);
}
/* set vector line type to GV_LINE, boundaries can cause problems */
@@ -311,7 +314,8 @@
if (flag.r->answer) {
getme = 0;
/* check gshhs bbox */
- if (w >= minx && w < maxx && e <= maxx && e > minx && s >= miny && s < maxy && n <= maxy && n > miny) {
+ if (w >= minx && w < maxx && e <= maxx && e > minx &&
+ s >= miny && s < maxy && n <= maxy && n > miny) {
getme = 1; /* inside current region */
}
else if (w < maxx && e > minx && s < maxy && n > miny) {
@@ -331,7 +335,7 @@
if (fread
((void *)&p, (size_t) sizeof(struct GSHHS_POINT),
(size_t) 1, fp) != 1)
- G_fatal_error("Error reading data.");
+ G_fatal_error(_("Error reading data"));
if (flip) {
p.x = swabi4((unsigned int)p.x);
@@ -379,8 +383,7 @@
cnt++;
}
else {
- G_debug(1,
- "skipped line box west: %f, east: %f, north: %f, south: %f",
+ G_debug(1, "skipped line box west: %f, east: %f, north: %f, south: %f",
w, e, n, s);
fseek(fp, (long)(h.n * sizeof(struct GSHHS_POINT)), SEEK_CUR);
cnt++;
@@ -421,7 +424,7 @@
Vect_subst_var(Fi->database, &VectMap));
if (driver == NULL) {
- G_fatal_error(_("Cannot open database %s by driver %s"),
+ G_fatal_error(_("Cannot open database <%s> by driver <%s>"),
Vect_subst_var(Fi->database, &VectMap), Fi->driver);
}
@@ -432,7 +435,7 @@
if (db_execute_immediate(driver, &sql) != DB_OK) {
db_close_database(driver);
db_shutdown_driver(driver);
- G_fatal_error(_("Cannot create table: %s"), db_get_string(&sql));
+ G_fatal_error(_("Cannot create table: <%s>"), db_get_string(&sql));
}
if (db_create_index2(driver, Fi->table, cat_col_name) != DB_OK)
@@ -440,7 +443,7 @@
if (db_grant_on_table
(driver, Fi->table, DB_PRIV_SELECT, DB_GROUP | DB_PUBLIC) != DB_OK)
- G_fatal_error(_("Cannot grant privileges on table %s"), Fi->table);
+ G_fatal_error(_("Cannot grant privileges on table <%s>"), Fi->table);
db_begin_transaction(driver);
@@ -452,7 +455,7 @@
if (db_execute_immediate(driver, &sql) != DB_OK) {
db_close_database(driver);
db_shutdown_driver(driver);
- G_fatal_error(_("Cannot insert new row: %s"),
+ G_fatal_error(_("Cannot insert new row: <%s>"),
db_get_string(&sql));
}
}
@@ -543,7 +546,7 @@
/* reprojection is v.in.gshhs specific */
if (G_projection() != PROJECTION_LL) {
if (pj_do_proj(&currx, &curry, &info_in, &info_out) < 0) {
- G_fatal_error("Error in coordinate transformation");
+ G_fatal_error(_("Error in coordinate transformation"));
}
}
Vect_append_point(BPoints, currx, curry, 0.);
More information about the grass-commit
mailing list