[GRASS-SVN] r34227 - grass-addons/vector/v.in.postgis.sqlquery
svn_grass at osgeo.org
svn_grass at osgeo.org
Mon Nov 10 09:03:32 EST 2008
Author: mathieug
Date: 2008-11-10 09:03:31 -0500 (Mon, 10 Nov 2008)
New Revision: 34227
Added:
grass-addons/vector/v.in.postgis.sqlquery/v.in.postgis.sqlquery.html
Log:
added html help file
Added: grass-addons/vector/v.in.postgis.sqlquery/v.in.postgis.sqlquery.html
===================================================================
--- grass-addons/vector/v.in.postgis.sqlquery/v.in.postgis.sqlquery.html (rev 0)
+++ grass-addons/vector/v.in.postgis.sqlquery/v.in.postgis.sqlquery.html 2008-11-10 14:03:31 UTC (rev 34227)
@@ -0,0 +1,91 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html>
+<head>
+<title>v.in.postgis.sqlquery</title>
+<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
+<link rel="stylesheet" href="grassdocs.css" type="text/css">
+</head>
+<body bgcolor="white">
+
+<img src="grass.smlogo.gif" alt="GRASS logo"><hr align=center size=6 noshade>
+
+<h2>NAME</h2>
+<em><b>v.in.postgis.sqlquery</b></em> - Create a grass layer from any sql query in postgis
+<h2>KEYWORDS</h2>
+postgis, grass layer, sql
+<h2>SYNOPSIS</h2>
+<b>v.in.postgis.sqlquery</b><br>
+<b>v.in.postgis.sqlquery help</b><br>
+<b>v.in.postgis.sqlquery</b> [-<b>dzrg</b>] <b>sqlquery</b>=<em>string</em> <b>geometryfield</b>=<em>string</em> [<b>output</b>=<em>string</em>]
+
+<h3>Flags:</h3>
+<DL>
+<DT><b>-d</b></DT>
+<DD>import result in grass dbf format (no new table in postgis). If not set, the grass layer will be directly connected to the postgis new table</DD>
+
+<DT><b>-z</b></DT>
+<DD>use -z for v.in.ogr (create 3D output)</DD>
+
+<DT><b>-r</b></DT>
+<DD>use -o for v.in.ogr (override dataset projection)</DD>
+
+<DT><b>-g</b></DT>
+<DD>add a gist index to the imported table in postgis (useless with the d flag)</DD>
+
+
+
+<h3>Parameters:</h3>
+<DL>
+
+<DT><b>sqlquery</b>=<em>name</em></DT>
+<DD>Arbitrary sql query returning a recordset with geometry for each row </DD>
+
+<DT><b>geometryfield</b>=<em>name</em></DT>
+<DD>Name of the source geometry field. Usually defaults to the_geom but needed if a geometry function was used (for example, centroid), or if the table has many geometry columns</DD>
+
+<DT><b>output</b>=<em>name</em></DT>
+<DD>Name of the geographic postgis table where to place the query results. Will be the name of the imported grass layer. If -d flag is set, this table is deleted and replaced by a dbf attribute table. Use a different name than the original. Do not use capital letters </DD>
+
+
+</DL>
+<h2>DESCRIPTION</h2>
+
+<em>v.in.postgis.sqlquery</em> is a shell script to import as a grass layer the result of any sql query returning geometry. There are two main modes : i)grass native format import with attributes in a dbf file. No tables are added in PostGIS ; ii)Grass layer import with attributes directly connected to a temporary table in PostGIS containing the query results.
+Before using the script, db.connect (and eventually db.login) commands must have been called.
+The script has been tested with Linux and WinGrass. However, for winGrass, you should modify the home directory setting at the beginning of the script.
+Logfile is written in the directory specified by the LOGFILE environment variable (default : home directory).
+
+
+<h2>EXAMPLES</h2>
+
+<li><B>PostGIS sql query to grass map </B>(dbf attributes table, no new table in postgis)<BR>
+<div class="code"><pre>
+v.in.postgis.sqlquery -d sqlquery="SELECT * FROM zones, data WHERE zones.zone_id=data.zone_id AND value > 100" output=zones
+</pre></div>
+
+<li><B>work in Grass directly on a PostGIS table</B> (a new table is added in postgis, create a gist index)<BR>
+<div class="code"><pre>
+v.in.postgis.sqlquery -r -g sqlquery="SELECT value, centroid(geocolumn) AS locations FROM zones, data WHERE zones.zone_id=data.zone_id
+GROUP BY name" geometryfield=locations output=locations
+</pre></div>
+
+<BR>
+
+<h2>SEE ALSO</h2>
+
+<em><a HREF="db.connect.html">db.connect</a></em>,
+<em><a HREF="db.login.html">db.login</a></em>,
+<em><a HREF="v.in.ogr">v.in.ogr</a></em>,
+
+
+<h2>AUTHOR</h2>
+
+Mathieu Grelier, greliermathieu at gmail.com
+<br>
+
+<p>
+<i>Last changed: $Date: 2007/10/10 12:10:14 $</i>
+<HR>
+<P><a href="index.html">Main index</a> - <a href="vector.html">vector index</a> - <a href="full_index.html">Full index</a></P>
+</body>
+</html>
More information about the grass-commit
mailing list