[GRASS-dev] ascii export and import, large file problem

Glynn Clements glynn at gclements.plus.com
Wed Apr 18 11:42:04 EDT 2007


Hamish wrote:

> > Helena, I think the issue when I tried this before is that grass
> > doesn't know that x and y are in degrees while z is in meters. It
> > either assumes they are the same or uses the zfactor option to
> > multiply the z value by something to get it into the same units as x
> > and y.
> > 
> > But if I could tell grass that the z units were meters explicitly,
> > couldn't grass do the conversion automatically? Especially since the
> > conversion changes as you move north.
> 
> 
> http://article.gmane.org/gmane.comp.gis.grass.devel/19353/
> http://article.gmane.org/gmane.comp.gis.grass.devel/19523/
> 
> --relevant quotes--
> [1...]
> For a real y-axis label I think we need to add a new (optional) "units"
> element to the raster format (e.g. in cell_misc/).
> [2...]
> > The user should be able to add a title for the legend. 
> 
> For vlegends that's doable. For raster legends I hope to add
> G_set_raster_units() and G_get_raster_units() to write/read a simple
> string containing raster data units (set from "r.support units=") which
> will be stored in $MAPSET/cell_misc/$RASTERMAP/units. Raster legends and
> things like lat/lon NVIZ and r.shaded.relief could use the tag if it
> existed.
> --endquote--
> 
> apparently cell_misc/ is evil, so that moves it to
> $MAPSET/units/$RASTERMAP until GRASS7  when it moves to
> $MAPSET/raster/$RASTERMAP/units
> 
> I don't like to add another element dir to $MAPSET, but...

Given that cell_misc exists and can't easily be removed right now, you
may as well use it for now.

Just use the _misc functions which I recently added, i.e.

	char *G__file_name_misc(char *, const char *, const char *, const char *, const char *);
	char *G_find_file_misc(const char *, const char *, char *, const char *);
	char *G_find_file2_misc(const char *, const char *, const char *, const char *);
	int G__make_mapset_element_misc (const char *, const char *);
	int G_open_new_misc(const char *, const char *, const char *);
	int G_open_old_misc(const char *, const char *, const char *, const char *);
	int G_open_update_misc(const char *, const char *, const char *);
	FILE *G_fopen_new_misc(const char *, const char *, const char *);
	FILE *G_fopen_old_misc(const char *, const char *, const char *, const char *);
	FILE *G_fopen_append_misc(const char *, const char *, const char *);
	FILE *G_fopen_modify_misc(const char *, const char *, const char *);
	int G_remove_misc (const char *, const char *, const char *);

rather than using sprintf(element, "cell_misc/%s", name) hacks.

As for what to do in 7.x: having one directory per map with a file for
each element is neater, but that limits the number of maps in a mapset
to the filesystem's hard link count limit (32000 for ext2/ext3). We've
had at least one person complain about this.

-- 
Glynn Clements <glynn at gclements.plus.com>




More information about the grass-dev mailing list