Opened 17 years ago

Last modified 14 years ago

#822 closed enhancement (fixed)

GRASS5.7+ coordinate system patch

Reported by: warmerdam Owned by: warmerdam
Priority: high Milestone:
Component: GDAL_Raster Version: unspecified
Severity: minor Keywords: grass
Cc: Markus Neteler, Mateusz Łoskot

Description (last modified by Mateusz Łoskot)


find attached the patch to enable projection support in
the GRASS/GDAL plugin. It's fairly straightforward:

- added to the build process
- copies during compilation the files datum.table + ellipse.table
 from GRASS source code to /usr/.../share/ directory,
 within that I generate grass/etc/ to keep the structure
 clean. These files are used by GPJ_grass_to_wkt()

That's it. I don't face problems of circular dependencies
at it was once for Radim (maybe things changed in GRASS,
I don't remember).


* gdal/frmts/grass/pkg/configure:
   please run autoconf as I have an older version

* gdal/frmts/grass/grass57dataset.cpp:
- hardcoded path to fake_gisbase
- maybe hasGisbase can be retired, I left it for now

Hopefully it works as well for you so that GDAL (so also QGIS,
Mapserver etc) see the GRASS map projection.



Attachments (2)

grass_driver.diff (3.5 KB ) - added by warmerdam 17 years ago.
grass57_proj_support.diff (3.4 KB ) - added by neteler@… 17 years ago.
Updated patch to current CVS state

Download all attachments as: .zip

Change History (7)

by warmerdam, 17 years ago

Attachment: grass_driver.diff added


comment:1 by neteler@…, 17 years ago


would you mind to apply this patch? Would solve
- problem for gdal
- problem for the new R-stats interface
- problem for QGIS

I am still happy with it...



by neteler@…, 17 years ago

Attachment: grass57_proj_support.diff added

Updated patch to current CVS state

comment:2 by neteler@…, 17 years ago


let me express my interest to get this patch applied :-)



comment:3 by warmerdam, 17 years ago


I have tried it in my regular GDAL build, and it causes a configure failure
when testing for Xerces.  This appears to be due to grass_gproj linking back

checking for Xerces C++... requested, but compile or link fails!

g++ -I/usr/local/include -I/usr/local/include/xercesc -D_REENTRANT -o conftest
conftest.cpp -L/usr/local/lib -lxerces-c -lpthread
-L/u/pkg/Geo_DSDK- -lltidsdk -lpthread
-L/u/pkg/HDF42_inst/lib -lmfhdf -ldf -logdi31 -lcsf -L/usr/local/grass-6.0.0/lib
-lgrass_I -lgrass_vask -lgrass_gmath -lgrass_gis -lgrass_datetime -lgrass_gproj
-lz -lpthread -lm -lrt -ldl -L/u/pkg/kakadu-4.1.0/lib -lkdu

/home/warmerda/gdal/ warning: the 're_max_failures' variable is
obsolete and will go away.

configure: error: Please correct Xerces options, or don't enable Xerces.

I imagine this isn't a problem for building GRASS support as a plugin, but
it does - at least under some circumstances - screw it up for direct use
in GDAL. 

It might make sense to have the build logic "know" whether to use the
grass_gproj functions based on whether it is built in or not.  I'm not
sure to what extent this will be an issue on other platforms. 

For now I am backing the patch out again.  

comment:4 by warmerdam, 17 years ago

Patch incorporated as is.  It will be in GDAL 1.3.1. 

I have also rebuilt the plugin package and included the OGR GRASS driver.

comment:5 by Mateusz Łoskot, 14 years ago

Cc: Mateusz Łoskot added
Description: modified (diff)
Keywords: grass added
Note: See TracTickets for help on using tickets.