[GRASS-user] Using GRASS and PostGIS

Moritz Lennert mlennert at club.worldonline.be
Mon Oct 28 02:40:49 PDT 2019


On 22/10/19 21:41, Dheeraj Chand wrote:
> Hello, all,
> 
> I've been proximal to GRASS for several years but never really used it much. I am currently working on macOS Catalina. One of the things that I find is that GRASS can get a bit slow here, part of which I attribute to running on SQLite/Spatialite.
> 
> I know that GRASS and PostGIS have different topology models, but is there some way to use it in lieu of SQLite as the primary datastore? I suspect that the power of PostgreSQL could make things a lot less painful for some of the bigger tasks.

GRASS GIS supports PostgreSQL as database backend for attributes. You 
can set the default database backend in a mapset using db.connect [1]. 
Once this is set, any newly created vector map will use the defined 
backend. For existing maps see v.db.connect [2] and v.db.reconnect.all 
[3]. For general intro see [4].

If you want to store the actual geometries in PostGIS, you can use 
v.external [5] to link the data into a GRASS GIS mapset. You will not, 
however, profit of the full topological power you get when using the 
native GRASS GIS vector format.

Moritz


[1] https://grass.osgeo.org/grass78/manuals/db.connect.html
[2] https://grass.osgeo.org/grass78/manuals/v.db.connect.html
[3] https://grass.osgeo.org/grass78/manuals/v.db.reconnect.all.html
[4] https://grass.osgeo.org/grass78/manuals/databaseintro.html
[5] https://grass.osgeo.org/grass78/manuals/v.external.html


More information about the grass-user mailing list