Forráskód Böngészése

r.in.wms: python modules import fixed
manual page cleaned up


git-svn-id: https://svn.osgeo.org/grass/grass/trunk@37051 15284696-431f-4ddb-bdfa-cd5b030d7da7

Martin Landa 16 éve
szülő
commit
7075eb6c92
2 módosított fájl, 39 hozzáadás és 50 törlés
  1. 36 50
      scripts/r.in.wms/r.in.wms.html
  2. 3 0
      scripts/r.in.wms/r.in.wms.py

+ 36 - 50
scripts/r.in.wms/r.in.wms.html

@@ -1,34 +1,35 @@
-<H2>DESCRIPTION</H2>
+<h2>DESCRIPTION</h2>
 
 
-<EM>r.in.wms</EM>  handles all of downloading and importing raster data from
+<em>r.in.wms</em>  handles all of downloading and importing raster data from
 an <a href="http://www.opengeospatial.org/specs/?page=specs">OpenGIS</a>
 an <a href="http://www.opengeospatial.org/specs/?page=specs">OpenGIS</a>
-"WMS" web mapping server. It need only be told the desired data to collect
+WMS web mapping server. It need only be told the desired data to collect
 (bounds and resolution) via a region, the server to get the data from, and
 (bounds and resolution) via a region, the server to get the data from, and
 the layer or layers to get. It downloads the data in tiles, reprojects it,
 the layer or layers to get. It downloads the data in tiles, reprojects it,
 imports it, and patches it back together.
 imports it, and patches it back together.
 
 
-<H2>NOTES</H2>
+<h2>NOTES</h2>
 
 
 By default data is downloaded to $GISDBASE/wms_download. This can be changed
 By default data is downloaded to $GISDBASE/wms_download. This can be changed
-by setting the <EM>folder=</EM> option when using <EM>r.in.wms</EM>.
-<P>
+by setting the <b>folder</b> option when using <em>r.in.wms</em>.
+
+<p>
 To understand the data you are getting it is necessary to look at the
 To understand the data you are getting it is necessary to look at the
 capabilities of the WMS server. This should be available via a capabilities
 capabilities of the WMS server. This should be available via a capabilities
 request. This is an
 request. This is an
 <a href="http://wms.jpl.nasa.gov/wms.cgi?request=GetCapabilities">example
 <a href="http://wms.jpl.nasa.gov/wms.cgi?request=GetCapabilities">example
 capabilities request to NASA's OnEarth server</a>.
 capabilities request to NASA's OnEarth server</a>.
-<P>
+
+<p>
 Some brain-dead servers will only talk to certain web browsers. You can
 Some brain-dead servers will only talk to certain web browsers. You can
-fool these by adding "<tt>--user-agent=MSIE5.5</tt>" to <b>wgetoptions</b>
-or for curl adding "<tt>-A "MSIE5.5</tt>" to <b>curloptions</b>.
+fool these by adding <tt>--user-agent=MSIE5.5</tt> to <b>wgetoptions</b>
+or for curl adding <tt>-A "MSIE5.5"</tt> to <b>curloptions</b>.
 Other brain-dead servers will not accept queries in the form of POST data.
 Other brain-dead servers will not accept queries in the form of POST data.
 If you get an error try using the <b>-g</b> flag to force <em>r.in.wms</em>
 If you get an error try using the <b>-g</b> flag to force <em>r.in.wms</em>
 to send an atomic GET request instead.
 to send an atomic GET request instead.
 
 
+<h2>EXAMPLES</h2>
 
 
-<H2>EXAMPLES</H2>
-
-<H3>General Get Capabilities Request</H3>
+<h3>General Get Capabilities Request</h3>
 
 
 A capabilities request like
 A capabilities request like
 <a href="http://wms.jpl.nasa.gov/wms.cgi?request=GetCapabilities">http://wms.jpl.nasa.gov/wms.cgi?request=GetCapabilities</a>
 <a href="http://wms.jpl.nasa.gov/wms.cgi?request=GetCapabilities">http://wms.jpl.nasa.gov/wms.cgi?request=GetCapabilities</a>
@@ -36,29 +37,27 @@ is where you should start. It tells you what data is offered, the projections
 it is in,  where to find meta data, resolutions, scales, and bounds for
 it is in,  where to find meta data, resolutions, scales, and bounds for
 data, etc.
 data, etc.
 
 
-<H3>NASA OnEarth server: Get Capabilities Request</H3>
+<h3>NASA OnEarth server: Get Capabilities Request</h3>
 
 
 <div class="code"><pre>
 <div class="code"><pre>
 r.in.wms mapserver=http://wms.jpl.nasa.gov/wms.cgi -l
 r.in.wms mapserver=http://wms.jpl.nasa.gov/wms.cgi -l
 </pre></div>
 </pre></div>
 
 
-Lists the layers available from the NASA OnEarth server. The output is
-more reliable if <a href="http://ofb.net/~egnor/xml2/">xml2</a> is installed.
-
+Lists the layers available from the NASA OnEarth server.
 
 
-<H3>US NED Elevation from OnEarth server download (metric units)</H3>
+<h3>US NED Elevation from OnEarth server download (metric units)</h3>
 
 
 Set the resolution to 30 (assuming you're in metric units):
 Set the resolution to 30 (assuming you're in metric units):
 <div class="code"><pre>
 <div class="code"><pre>
 g.region res=30 -ap
 g.region res=30 -ap
-r.in.wms output=elevation_meters mapserver=http://wms.jpl.nasa.gov/wms.cgi \
-         layers=us_ned styles=real -o
+r.in.wms -o output=elevation_meters mapserver=http://wms.jpl.nasa.gov/wms.cgi \
+         layers=us_ned styles=real
 </pre></div>
 </pre></div>
 
 
 Downloads real number meter elevation from OnEarth to cover the current
 Downloads real number meter elevation from OnEarth to cover the current
-region. Uses -o for opaque to get smaller download.
+region. Uses <b>-o</b> for opaque to get smaller download.
 
 
-<H3>US NED Elevation from OnEarth server download (feet units)</H3>
+<h3>US NED Elevation from OnEarth server download (feet units)</h3>
 
 
 Set the resolution to 90 (assuming you're in feet units) a save this
 Set the resolution to 90 (assuming you're in feet units) a save this
 region with a name; this makes resuming downloads possible or rather
 region with a name; this makes resuming downloads possible or rather
@@ -68,8 +67,8 @@ easier:
 g.region res=90 -ap
 g.region res=90 -ap
 g.region save=panhandle-90ft
 g.region save=panhandle-90ft
 
 
-r.in.wms output=elevation_feet mapserver=http://wms.jpl.nasa.gov/wms.cgi \
-         layers=us_ned styles=feet_real -o region=panhandle-90ft
+r.in.wms -o output=elevation_feet mapserver=http://wms.jpl.nasa.gov/wms.cgi \
+         layers=us_ned styles=feet_real region=panhandle-90ft
 </pre></div>
 </pre></div>
 
 
 Downloads real number feet elevation from OnEarth to cover the current
 Downloads real number feet elevation from OnEarth to cover the current
@@ -77,17 +76,17 @@ region. Uses <B>-o</B> for opaque to get smaller download. Using a named
 region lets us resume later easily.
 region lets us resume later easily.
 
 
 <div class="code"><pre>
 <div class="code"><pre>
-r.in.wms output=elevation_feet mapserver=http://wms.jpl.nasa.gov/wms.cgi \
-         layers=us_ned styles=feet_real -o region=panhandle-90ft -d method=cubic
+r.in.wms -d output=elevation_feet mapserver=http://wms.jpl.nasa.gov/wms.cgi \
+         layers=us_ned styles=feet_real -o region=panhandle-90ft method=cubic
 </pre></div>
 </pre></div>
 
 
-<b>-d</b> skips ahead to downloading. This could be used to try
+Use flag <b>-d</b> to skip ahead to downloading. This could be used to try
 downloading again (if some files failed last time) or to import the data
 downloading again (if some files failed last time) or to import the data
 differently. Since downloaded files are remembered those already received
 differently. Since downloaded files are remembered those already received
 successfully are not re-requested. In this case we are reimporting the
 successfully are not re-requested. In this case we are reimporting the
 data using the cubic interpolation method instead of nearest neighbor.
 data using the cubic interpolation method instead of nearest neighbor.
 
 
-<H3>LANDSAT from OnEarth server download</H3>
+<h3>LANDSAT from OnEarth server download</h3>
 
 
 Set the resolution to 30 meters for LANDSAT:
 Set the resolution to 30 meters for LANDSAT:
 <div class="code"><pre>
 <div class="code"><pre>
@@ -98,7 +97,7 @@ r.in.wms layers=global_mosaic mapserver=http://wms.jpl.nasa.gov/wms.cgi \
 Downloads LANDSAT color scene.
 Downloads LANDSAT color scene.
 
 
 
 
-<H3>DRG from Terraserver server download</H3>
+<h3>DRG from Terraserver server download</h3>
 
 
 Set the resolution to 1.2 meters for DRGs. Their native resolution is
 Set the resolution to 1.2 meters for DRGs. Their native resolution is
 2.4 meters, so this is some pretty hefty oversampling:
 2.4 meters, so this is some pretty hefty oversampling:
@@ -115,32 +114,19 @@ Downloads digital raster graphics from Microsoft TerraServer. Note that
 srs will need to be changed to a projection that is appropriate for your
 srs will need to be changed to a projection that is appropriate for your
 region.
 region.
 
 
+<h2>SEE ALSO</h2>
 
 
-<H2>REQUIRED PROGRAMS</H2>
-
-<EM>r.in.wms</EM> requires the following programs to work:
-
-<ul>
-<li>wget: An http download program, or
-<li>curl: Alternate http download program
-<li>bc: A calculator program
-<li>sed, grep: Unix string processing and search programs
-<li><a href="http://www.gdal.org">gdalwarp</a>: A reprojection tool,
-    needed only if data is projected into this location.
-<li><a href="http://ofb.net/~egnor/xml2/">xml2</a>: An xml parser.
-    Enables more accurate listing of layers on the server.
-</ul>
-
-
-<H2>SEE ALSO</H2>
-<a href="r.tileset.html">r.tileset</a>,
-<a href="r.in.gdal.html">r.in.gdal</a>,
-<a href="r.patch.html">r.patch</a>
-
+<em>
+  <a href="r.tileset.html">r.tileset</a>,
+  <a href="r.in.gdal.html">r.in.gdal</a>,
+  <a href="r.patch.html">r.patch</a><br>
+  <a href="r.in.wfs.html">r.in.wfs</a>
+</em>
 
 
 <H2>AUTHORS</H2>
 <H2>AUTHORS</H2>
 
 
-Soeren Gebbert, Jachym Cepicky, and Cedric Shock
+Soeren Gebbert, Jachym Cepicky, and Cedric Shock<br>
+Updated for GRASS 7 by Martin Landa, CTU in Prague, Czech Republic (05/2009)
 
 
 <p>
 <p>
 <i>Last changed: $Date$</i>
 <i>Last changed: $Date$</i>

+ 3 - 0
scripts/r.in.wms/r.in.wms.py

@@ -193,6 +193,9 @@ from xml.sax import make_parser
 
 
 import grass
 import grass
 
 
+wmsPath = os.path.join(os.getenv('GISBASE'), 'etc', 'r.in.wms')
+sys.path.append(wmsPath)
+print wmsPath
 import wms_request
 import wms_request
 import wms_download
 import wms_download