[GRASS-dev] GDAL/Proj modules role in Grass
Markus Neteler
neteler at osgeo.org
Wed Apr 8 15:55:55 EDT 2009
hi Kavitesh,
On Wed, Apr 8, 2009 at 4:50 PM, <kavitesh.singh at wipro.com> wrote:
> Hi Markus,
>
> Thank you for prompt reply. I would like to further ask you few more
> questions, and sure you would overlook my ignorance.
no problem - also others are invited to contribute of course :)
> My requirement is to make a strip down GIS tool using GRASS engine focusing
> on raster image for the time being and preferably on windows platform.
Ok!
BTW: in case that you want a Web based solution, also consider WPS,
e.g. pyWPS:
http://pywps.wald.intevation.org/
Some working example also here:
http://pywps.ominiverdi.org/
> I would prefer to use the GRASS data format so that I am not bounded on any
> commercial file format for my application and also provide user the option
> to use GRASS or Quantum GIS.
Perfect! (see also somewhat related
http://blog.cleverelephant.ca/2009/04/esri-formats-back-to-future.html
)
BTW: Using the GDAL-GRASS plugin, you get the API to read and
write GRASS' raster and vector data to other formats.
r.in.gdal/r.out.gdal and v.in.gdal/v.out.gdal use GDAL to read/write
to other formats.
Also QGIS and other software packages make use of this interface.
> Please highlight the following doubts:
>
> 1. The grass would be providing me APIs where in I can take any raster
> image, geo-reference it and then store in GRASS’s native format. Can you
> please point out to the modules I would require just to perform this action?
Perhaps you should consider the Python bindings if you like that language:
http://download.osgeo.org/grass/grass6_progman/
-> GRASS SWIG interface
-> Python
It is not greatly documented but already used in the wxPython GUI:
gui/wxpython/
Relevant command (focusing on raster here): r.in.gdal
What do you really mean with geo-referencing? do you have scanned XY
data or so? Ideally your data come with metadata describing projection
and such. This is then respected by r.in.gdal and the imported map
written out to the GRASS native format,.
Option: just "register" the external map file as virtual map with r.external.
That's way faster of course.
> 2. Once I have converted to the GRASS native format, I would like to
> display the image in visual form. Now you have pointed to several options
> available with the existing version. I wanted to know is the display
> eventually like a photo viewer especially when GRASS is layering the
> information one over another.
Right, GRAS uses the layer concept.
Get transparency through g.pnmcomp.html
BTW: manual
http://grass.osgeo.org/grass64/manuals/html64_user/
> Also would grass provide me some standardized
> output in terms of jpg, bmp etc which I can display in any application? Any
> pointers to the similar options available on windows platform?
No problem:
d.out.file
r.out.gdal
>> 2. The input to the GDAL can be any raster format like BMP, GeoTIFF,
>
>> TIFF, PNG etc. What would be the output format GDAL produces after it
>> manipulates the original raster image.
About 30 formats or so are supported:
http://www.gdal.org/formats_list.html
(see "Creation" column)
>> If the input is geo-coded incl. metadata, this is respected. Otherwise it
>> is imported as XY map.
>
>
> So if the information is geo-coded already, GRASS would not perform any
> additionally operation but will still convert and store in the native
> format. Correct?
Right. Or see r.external for making an external map visible without really
importing it.
Or, use the GDAL-GRASS plugin and look at the map in native GRASS
format without exporting (faster of course).
Get the plugin from the GDAL site (or your preferred distribution)
> Additionally, if I have to display a GDAL processed input, does GRASS let me
> do that? Or are there tools which will help me see and understand what
> exactly is the output. (I hope I am able to present my point)
Mhh, not entirely clear to me.
> It is my understanding, that OGR would be similar to GDAL with focus on the
> vector data, which is further converted to the GRASS native format for
> processing and viewing.
Right.
"Small" difference: GRASS is using a topological vector format while
GDAL is non-topological. Both v.in.ogr (v.out.ogr) and the OGR-GRASS plugin
translate between these worlds.
E.g. also the ESRI SHAPE format is non-topological.
> I have worked mostly on windows platform, hence there are lot of questions
> as GRASS is based on Linux and current winGrass version is using the cygwin.
> Though I was reading the full windows version would be out soon.
It's available since the other day, just download it here:
Stand-alone installer:
http://download.osgeo.org/grass/grass64/binary/mswindows/native/
OSGeo4W bundle:
http://trac.osgeo.org/osgeo4w/
> The architecture diagram was really helpful in getting the overall idea of
> where all libraries fit in.
>
> Thanks a lot..
You are welcome.
best
Markus
More information about the grass-dev
mailing list