[GRASS-dev] some questions about future development

Hi to everyone.
In the last period I’ve been working a lot with GRASS for my daily job, and it permitted me to develop a series of wishes for the future…
I will share them in the GRASS 7 ideas collection but I would like to ask some questions before:

VECTORS

1 - OGR datasources: one important GIS functionality in daily work is the possibility to access shapefiles, and other simple feature datas (PostGIS, Oracle Spatial, etc.) directly, without having to import them and/or building the topology. Many times these datas are simply used for visualization (geometries and attributes), or table attributes management…
I’ve seen it is already in the Radim’s TODO list [1].
Is it a priority in GRASS 7 development, or it is left as a minor enhancement?

2 - geometry highlighting: when selecting features from the attributes table (wxGUI), it would be nice to make the geometries highlighted in the map window… See next section.

3 - vectors/thematic vectors: it happens only in GRASS that these two are separated. Wouldn’t be better to merge into a single display command with thmatic styiling as options?

MAP CANVAS

the user experience with the maps should be enhanced:

1 - when zooming, incremental resolution would be nice (pyramids for rasters?)
2 - when panning, only the new areas should be added (a sort of tiling)
3 - geometry selection (like with “identify” tools, or polygonal selection tools) ->view selected features inside the table attributes, and viceversa

I know it is quite distant from the actual display architecture, but it would be an important improvement from my point of view…
Do you think it will be feasible considering the rodmap you’ve planned?

Ok, it’s enough for now. I would have many other proposals, but I will share them in the future :slight_smile:

Giovanni

[1] http://freegis.org/cgi-bin/viewcvs.cgi/grass6/doc/vector/TODO?rev=HEAD&content-type=text/vnd.viewcvs-markup

G. Allegri ha scritto:

1 - OGR datasources: one important GIS functionality in daily work is
the possibility to access shapefiles, and other simple feature datas
(PostGIS, Oracle Spatial, etc.) directly, without having to import them
and/or building the topology. Many times these datas are simply used for
visualization (geometries and attributes), or table attributes management...
I've seen it is already in the Radim's TODO list [1].
Is it a priority in GRASS 7 development, or it is left as a minor
enhancement?

v.external?
http://grass.itc.it/grass62/manuals/html62_user/v.external.html
BTW, a r.external would be a great addition.

All the best.
pc
--
Paolo Cavallini, see: * http://www.faunalia.it/pc *

v.external?
http://grass.itc.it/grass62/manuals/html62_user/v.external.html
BTW, a r.external would be a great addition.

Hi Paolo,
I know v.external, but It's still a bit far from what the user
experience is in, let's say, Qgis/uDig/gvSIG/etc.
The main restriction is that it's read-only. It would be an important
improvement having (at least) attributes and table management for
shapefiles.
The pseudo-topoligy building is too slow for what this feature is for:
not allowing spatial operations, or any other geoprocessing, but just
visualization and attributes management...
I would expect something like "Add datasource" and (in wxGUI) having
it displayed in the Layer Manager.

Just ideas... I know it's not so simple :slight_smile:

On Mon, Aug 18, 2008 at 10:30 AM, Paolo Cavallini <cavallini@faunalia.it> wrote:
...

BTW, a r.external would be a great addition.

Yes, see:
http://trac.osgeo.org/grass/browser/grass/branches/releasebranch_5_4/gips/gip-0002.txt

Still not implemented... next GSoC project?

Markus

Markus Neteler wrote:

> BTW, a r.external would be a great addition.

Yes, see:
http://trac.osgeo.org/grass/browser/grass/branches/releasebranch_5_4/gips/gip-0002.txt

Still not implemented... next GSoC project?

It's not that much work.

I have attached a "first draft" patch which adds the essential support
to lib/gis. It has only been minimally tested, but seems to work.

To test:

1. Copy a raster map.
2. Export it to an image at its native resolution.
3. Create a cell_misc/<name>/gdal file consisting of two lines: the
filename followed by the band number.
4. Edit the cellhd/<name> file so that "compressed" is 0, and (if it's
a CELL map) "format" is 3.
5. Run "r.support -s <name>" to update the range.

Tomorrow, I'll look into creating an r.external module, adding null
support, etc.

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

(attachments)

gdal-link.diff (8.28 KB)

Glynn Clements pisze:

Markus Neteler wrote:

BTW, a r.external would be a great addition.

Yes, see:
http://trac.osgeo.org/grass/browser/grass/branches/releasebranch_5_4/gips/gip-0002.txt

Still not implemented... next GSoC project?

It's not that much work.

I have attached a "first draft" patch which adds the essential support
to lib/gis. It has only been minimally tested, but seems to work.

To test:

1. Copy a raster map.
2. Export it to an image at its native resolution.
3. Create a cell_misc/<name>/gdal file consisting of two lines: the
filename followed by the band number.
4. Edit the cellhd/<name> file so that "compressed" is 0, and (if it's
a CELL map) "format" is 3.
5. Run "r.support -s <name>" to update the range.

Tomorrow, I'll look into creating an r.external module, adding null
support, etc.

Great! Finally there would be no need to import rasters if they are
to be used only as a backdrop for digitising.

If the external GeoTIFF has overviews, will r.external support them?
Will they speed up such map's display in GRASS?

Maciek

--
Maciej Sieczka
www.sieczka.org

Glynn Clements wrote:

> > BTW, a r.external would be a great addition.
>
> Yes, see:
> http://trac.osgeo.org/grass/browser/grass/branches/releasebranch_5_4/gips/gip-0002.txt
>
> Still not implemented... next GSoC project?

It's not that much work.

I have attached a "first draft" patch which adds the essential support
to lib/gis. It has only been minimally tested, but seems to work.

To test:

1. Copy a raster map.
2. Export it to an image at its native resolution.
3. Create a cell_misc/<name>/gdal file consisting of two lines: the
filename followed by the band number.
4. Edit the cellhd/<name> file so that "compressed" is 0, and (if it's
a CELL map) "format" is 3.
5. Run "r.support -s <name>" to update the range.

Tomorrow, I'll look into creating an r.external module, adding null
support, etc.

Okay, done (well, enough to try it out without having to manually hack
the files; null support is absent).

At present, r.external is built automatically, but the code to read
linked maps is conditionalised upon GDAL_LINK, so you need to build
with "make GDAL_LINK=1". If you forget that part, r.external will
work, but attempting to read the map will fail (the cell/fcell files
are zero-length).

  $ r.external help
  
  Description:
   Link GDAL supported raster file to a binary raster map layer.
  
  Keywords:
   raster, import
  
  Usage:
   r.external [-oef] [input=name] [output=name] [band=value]
     [title="phrase"] [--overwrite] [--verbose] [--quiet]
  
  Flags:
    -o Override projection (use location's projection)
    -e Extend location extents based on new dataset
    -f List supported formats and exit
   --o Allow output files to overwrite existing files
   --v Verbose module output
   --q Quiet module output
  
  Parameters:
     input Raster file to be linked
    output Name for output raster map
      band Band to select
             default: 1
     title Title for resultant raster map

Much of the code was salvaged from r.in.gdal, along with some of the
behaviour. E.g. if you link a non-georeferenced file into a
georeferenced (non-X/Y) location, you'll get an error about the
projection mismatch unless you also use -o.

The range, colour table and any geo-referencing information are taken
from the original data. A title can be given with title=, and an
auto-generated history (G_short_history(), G_command_history()) is
added. No histogram is generated (use "r.support -s" if you want one).

I daresay that something this fundamental will need significant
testing.

Known issues at present:

Null support is missing (r.external records any null value reported by
GDAL, but G_get_raster_row() etc ignore it; I suspect that it will
treat zero as null due to the absence of a null file).

The code which retrieves the range tells GDAL that approximate values
will suffice (requiring exact values requires reading the entire map,
in which case you may as well just use r.in.gdal).

No attempt is made to detect any changes to the underlying file. I
don't even know if this is possible, given that the details of which
files make up a GDAL "data source" are known only unto GDAL.

The input= parameter is stored verbatim. If this is a file (rather
than some non-file data source), you probably want to ensure that it's
an absolute pathname, otherwise the map will cease to work if you
change directory. Actually, the input= option is tagged as old_file,
so non-file data sources won't work.

If the original data is GDT_UInt32, it's still treated as a CELL map,
even though CELL is signed. If the input has values above 2^32-1, they
will wrap. GDT_UInt16 should work correctly, though.

Complex types aren't supported.

The r.in.gdal source implies that AVHRR data needs to be flipped
top-to-bottom; this isn't implemented.

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

Glynn Clements wrote:

Known issues at present:

Null support is missing (r.external records any null value reported by
GDAL, but G_get_raster_row() etc ignore it; I suspect that it will
treat zero as null due to the absence of a null file).

Null support has been added.

The code which retrieves the range tells GDAL that approximate values
will suffice (requiring exact values requires reading the entire map,
in which case you may as well just use r.in.gdal).

r.external now has a -r flag to tell GDAL to compute the exact range
rather than an approximation.

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