<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">I think that maybe my request was unclear, sorry.<div class=""><br class=""></div><div class="">I am okay and comfortable with GRASS on how to use it, but not on the man pages about how to edit the source code to patch/change it.</div><div class=""><br class=""></div><div class="">What I was really hoping for was to avoid having two spatial databases, one PostGIS and one GRASS, with the idea that GRASS would store <i class="">everything</i> in PostGIS with perhaps its only specific column for its own geometries.</div><div class=""><br class=""></div><div class="">I guess not!</div><div class=""><br class=""></div><div class=""><br class=""></div><div class=""><div><br class=""><blockquote type="cite" class=""><div class="">On Aug 15, 2020, at 9:10 AM, Micha Silver <<a href="mailto:tsvibar@gmail.com" class="">tsvibar@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div class="moz-cite-prefix" style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;"><br class="Apple-interchange-newline">On 15/08/2020 16:22, Dheeraj Chand wrote:<br class=""></div><blockquote type="cite" cite="mid:E887B402-9E75-44A9-A4C9-FA58D7C012AB@dheerajchand.com" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; text-decoration: none;" class="">‘’’<div class=""><br style="caret-color: rgb(0, 0, 0);" class=""><span style="caret-color: rgb(0, 0, 0);" class="">When importing a shapefile or other vector data, only the attrib tables get saved to some database: sqlite by default, or PostgrSQL if you have configured for that backend. But the geometry is still kept in the GRASS vector format.</span></div><div class=""><font class=""><span style="caret-color: rgb(0, 0, 0);" class="">‘’’</span></font></div><div class=""><font class=""><span style="caret-color: rgb(0, 0, 0);" class=""><br class=""></span></font></div><div class=""><font class=""><span style="caret-color: rgb(0, 0, 0);" class="">1. How would one configure that? Please assume that I am unfamiliar and uncomfortable with GRASS when explaining, but able to read Java and Python man pages with ease, also comfortable with PSQL and PostGIS.</span></font></div></blockquote><div style="margin-bottom: 0cm; margin-top: 0pt; caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class="">In that case you might want to first go thru some tutorials on using GRASS. We're here to help if encounter anything that is unclear, or not working as you expected.</div><div style="margin-bottom: 0cm; margin-top: 0pt; caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class="">All GRASS commands can be called thru the GRASS-python bindings, so that might be easiest for you. But do go into the beginning tutorials first.</div><div style="margin-bottom: 0cm; margin-top: 0pt; caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class="">The GRASS module that sets the backend database connection is `db.connect`. Have a look at the man page:</div><div style="margin-bottom: 0cm; margin-top: 0pt; caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><a class="moz-txt-link-freetext" href="https://grass.osgeo.org/grass78/manuals/db.connect.html">https://grass.osgeo.org/grass78/manuals/db.connect.html</a></div><div style="margin-bottom: 0cm; margin-top: 0pt; caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class="">You would choose the driver parameter as "pg", then set the database and schema as required. This comes after running `db.login` one time to save your DB auth credentials.</div><div style="margin-bottom: 0cm; margin-top: 0pt; caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><br class=""></div><blockquote type="cite" cite="mid:E887B402-9E75-44A9-A4C9-FA58D7C012AB@dheerajchand.com" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><div class=""><font class=""><span style="caret-color: rgb(0, 0, 0);" class="">2. Would we get all the speed benefits of PSQL, would it be used for computations whenever possible?</span></font></div></blockquote><div style="margin-bottom: 0cm; margin-top: 0pt; caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class="">Not sure how to answer here. GRASS in general sends SQL commands back to the DB backend for any undates. If, for example, you had a point vector of cities, with two columns "population" and "number_hospitals" in the attribute table, and you wanted to calculate number of hospitals per 1000 people, then you would construct a regular SQL query that would be sent to the backend. So I guess that the speed would be determined by PostgreSQL.</div><div style="margin-bottom: 0cm; margin-top: 0pt; caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><br class=""></div><blockquote type="cite" cite="mid:E887B402-9E75-44A9-A4C9-FA58D7C012AB@dheerajchand.com" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><div class=""><font class=""><span style="caret-color: rgb(0, 0, 0);" class="">3. Is there a way to easily move from GRASS and PSQL geometry and topology models when doing this?</span></font></div></blockquote><div style="margin-bottom: 0cm; margin-top: 0pt; caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class="">Sorry to repeat again: GRASS maintains all geometry (and topology) within its own internal vector data structure. NO PostGIS involved here. But You could easily export GRASS vectors to a PostGIS database using the `v.out.postgis` module.</div><div style="margin-bottom: 0cm; margin-top: 0pt; caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><a class="moz-txt-link-freetext" href="https://grass.osgeo.org/grass78/manuals/v.out.postgis.html">https://grass.osgeo.org/grass78/manuals/v.out.postgis.html</a></div><div style="margin-bottom: 0cm; margin-top: 0pt; caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><br class=""></div><div style="margin-bottom: 0cm; margin-top: 0pt; caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class="">To pull a PostGIS vector table into GRASS would require either `v.in.ogr` or `v.import`</div><div style="margin-bottom: 0cm; margin-top: 0pt; caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><br class=""></div><blockquote type="cite" cite="mid:E887B402-9E75-44A9-A4C9-FA58D7C012AB@dheerajchand.com" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><div class=""><br class=""><div dir="ltr" class="">Sent from my iPhone</div><div dir="ltr" class=""><br class=""><blockquote type="cite" class="">On Aug 15, 2020, at 7:50 AM, Rich Shepard<span class="Apple-converted-space"> </span><a class="moz-txt-link-rfc2396E" href="mailto:rshepard@appl-ecosys.com"><rshepard@appl-ecosys.com></a><span class="Apple-converted-space"> </span>wrote:<br class=""><br class=""></blockquote></div><blockquote type="cite" class=""><div dir="ltr" class=""><span class="">On Sat, 15 Aug 2020, Micha Silver wrote:</span><br class=""><span class=""></span><br class=""><blockquote type="cite" class=""><span class="">But again, don't confuse - this is NOT PostGIS, and GRASS does not</span><br class=""></blockquote><blockquote type="cite" class=""><span class="">need/use PostGIS for geometry. GRASS geometry is always independent of any</span><br class=""></blockquote><blockquote type="cite" class=""><span class="">external geospatial format.</span><br class=""></blockquote><span class=""></span><br class=""><span class="">Micha,</span><br class=""><span class=""></span><br class=""><span class="">Thanks for clarifying; I must have mis-understood what I read. I assumed the</span><br class=""><span class="">geometry was kept by GRASS and didn't know why PostGIS was mentioned ... and</span><br class=""><span class="">I don't recall just where I read all this.</span><br class=""><span class=""></span><br class=""><blockquote type="cite" class=""><span class="">It's the other way around: When you export GRASS map layers, you can, as</span><br class=""></blockquote><blockquote type="cite" class=""><span class="">you know, choose to save out to several formats: shp, Geopackage (the</span><br class=""></blockquote><blockquote type="cite" class=""><span class="">current default) or to PostGIS. PostGIS is the best choice when you need</span><br class=""></blockquote><blockquote type="cite" class=""><span class="">multiuser access to the geospatial data. But you point out that you're the</span><br class=""></blockquote><blockquote type="cite" class=""><span class="">only user, so why would you need the overhead of PostGIS?</span><br class=""></blockquote><span class=""></span><br class=""><span class="">Ah, so. I don't.</span><br class=""><span class=""></span><br class=""><blockquote type="cite" class=""><span class="">To repeat, you can set the default for saving attribute tables to</span><br class=""></blockquote><blockquote type="cite" class=""><span class="">PostgreSQL, but do not try to save a GRASS layer to PostGIS in the same</span><br class=""></blockquote><blockquote type="cite" class=""><span class="">database! That will definitely lead to trouble. If you want/need a PostGIS</span><br class=""></blockquote><blockquote type="cite" class=""><span class="">instance for some reason independent of GRASS, then keep it totally</span><br class=""></blockquote><blockquote type="cite" class=""><span class="">separated from GRASS. i.e. at least in a separate schema or even separate</span><br class=""></blockquote><blockquote type="cite" class=""><span class="">database.</span><br class=""></blockquote><span class=""></span><br class=""><span class="">No, I want the attribute data in postgres so I need to learn to make that</span><br class=""><span class="">the default.</span><br class=""><span class=""></span><br class=""><blockquote type="cite" class=""><span class="">The main reasons for choosing PostgreSQL as your database backend would be</span><br class=""></blockquote><blockquote type="cite" class=""><span class=""></span><br class=""></blockquote><blockquote type="cite" class=""><span class="">1. to allow fancy SQL queries on the database tables</span><br class=""></blockquote><blockquote type="cite" class=""><span class="">2. huge, complex data tables or triggers</span><br class=""></blockquote><blockquote type="cite" class=""><span class="">3. multiuser access to the attribute tables</span><br class=""></blockquote><span class=""></span><br class=""><span class="">My reason is keeping these data in the same format as other project data.</span><br class=""><span class=""></span><br class=""><blockquote type="cite" class=""><span class="">But keep in mind that the default sqlite database is quite powerful, and you would have to look very deeply to find a PostgreSQL feature that is missing in sqlite.</span><br class=""></blockquote><span class=""></span><br class=""><span class="">Yes, I've been using SQlite as long as I have PostgreSQL.</span><br class=""><span class=""></span><br class=""><span class="">Thanks,</span><br class=""><span class=""></span><br class=""><span class="">Rich</span><br class=""><span class="">_______________________________________________</span><br class=""><span class="">grass-user mailing list</span><br class=""><span class=""><a class="moz-txt-link-abbreviated" href="mailto:grass-user@lists.osgeo.org">grass-user@lists.osgeo.org</a></span><br class=""><span class=""><a class="moz-txt-link-freetext" href="https://lists.osgeo.org/mailman/listinfo/grass-user">https://lists.osgeo.org/mailman/listinfo/grass-user</a></span></div></blockquote></div><br class=""><fieldset class="mimeAttachmentHeader"></fieldset><pre class="moz-quote-pre" wrap="">_______________________________________________
grass-user mailing list
<a class="moz-txt-link-abbreviated" href="mailto:grass-user@lists.osgeo.org">grass-user@lists.osgeo.org</a>
<a class="moz-txt-link-freetext" href="https://lists.osgeo.org/mailman/listinfo/grass-user">https://lists.osgeo.org/mailman/listinfo/grass-user</a></pre></blockquote><pre class="moz-signature" cols="72" style="caret-color: rgb(0, 0, 0); font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;">--
Micha Silver
Ben Gurion Univ.
Sde Boker, Remote Sensing Lab
cell: +972-523-665918
<a class="moz-txt-link-freetext" href="https://orcid.org/0000-0002-1128-1325">https://orcid.org/0000-0002-1128-1325</a></pre></div></blockquote></div><br class=""></div></body></html>