Skip to content

Commit

Permalink
Move the help to the end, add examples
Browse files Browse the repository at this point in the history
  • Loading branch information
sbrunner committed Nov 30, 2024
1 parent 901597b commit 83657d2
Show file tree
Hide file tree
Showing 3 changed files with 57 additions and 40 deletions.
95 changes: 56 additions & 39 deletions tilecloud_chain/templates/admin_index.html
Original file line number Diff line number Diff line change
Expand Up @@ -138,45 +138,6 @@ <h2>Launch generation</h2>
<span id="result"></span>
%endif

<!---->
%if request.identity.is_auth:
<h3>Usage</h3>
<h4><code>generate-tiles</code></h4>
<p>Generate the tiles.</p>
<p>Arguments:</p>
<ul>
<li>
<code>--layer=NAME</code>: the layer name to generate, it not specified all the layers are generated.
</li>
<li>
<code>--get-hash=Z/X/Y</code>: get the hash configuration for the layer (requires
<code>--layer</code>).
</li>
<li>
<code>--get-bbox=Z/X/Y[:-N/+N]</code>: get the bbox of a tile, use the specified tile
<code>Z/X/Y</code>, or <code>Z/X/Y:+N/+N</code> for metatiles (requires <code>--layer</code>).
</li>
<li>
<code>--dimensions DIMENSION=VALUE [DIMENSION=VALUE ...]</code>: overwrite the dimensions values
specified in the config file.
</li>
<li>
<code>--zoom=ZOOM</code> restrict to specified zoom level, or a zooms range (2-5), or a zooms list
(2,4,5).
</li>
<li><code>--bbox MINX MINY MAXX MAXY</code>: restrict to specified bounding box.</li>
<li>
<code>--near X Y</code>: This option is a good replacement of <code>--bbox</code>, to used with
<code>--time</code> or <code>--test</code> and <code>--zoom</code>, implies <code>--no-geom</code>. It
automatically measure a bbox around the X Y position that corresponds to the metatiles.
</li>
<li><code>--test N</code>: test with generating N tiles.</li>
</ul>

<h4><code>generate-controller --generate-legend-images</code></h4>
<p>Generate the legend images.</p>
%endif

<h2>Test</h2>
<p>See the result in <a href="/${admin_path}/test">the test page</a>.</p>

Expand Down Expand Up @@ -289,6 +250,62 @@ <h4>Errors occur during the generation (max 5)</h4>
<div class="${ footer_classes }">${ footer }</div>
%endif

<!---->
%if request.identity.is_auth:
<h3>Command help</h3>
<h4>Examples</h4>

<p><code>generate-tiles</code>: Generate all the layers.</p>
<p><code>generate-tiles --layer=LAYER</code>: Generate the <code>LAYER</code> map.</p>
<p>
<code>generate-tiles --layer=LAYER --zoom=2-5</code>: Generate the <code>LAYER</code> map for the zoom
levels 2 to 5.
</p>
<p>
<code>generate-tiles --layer=LAYER --bbox MINX MINY MAXX MAXY</code>: Generate the
<code>LAYER</code> map for the specified bounding box.
</p>
<p><code>generate-controller --generate-legend-images</code>: Generate the legend images.</p>
<p>
<code>generate-tiles --layer=LAYER --get-hash=15/0/0</code>: Get the hash for the <code>LAYER</code>.
</p>
<p><code>generate-tiles --layer=LAYER --get-bbox=0/0/0</code>: Get the bbox of the tile.</p>

<h4><code>generate-tiles</code></h4>
<p>Generate the tiles.</p>
<p>Arguments:</p>
<ul>
<li>
<code>--layer=NAME</code>: the layer name to generate, it not specified all the layers are generated.
</li>
<li>
<code>--get-hash=Z/X/Y</code>: get the hash configuration for the layer (requires
<code>--layer</code>).
</li>
<li>
<code>--get-bbox=Z/X/Y[:-N/+N]</code>: get the bbox of a tile, use the specified tile
<code>Z/X/Y</code>, or <code>Z/X/Y:+N/+N</code> for metatiles (requires <code>--layer</code>).
</li>
<li>
<code>--dimensions DIMENSION=VALUE [DIMENSION=VALUE ...]</code>: overwrite the dimensions values
specified in the config file.
</li>
<li>
<code>--zoom=ZOOM</code> restrict to specified zoom level, or a zooms range (2-5), or a zooms list
(2,4,5).
</li>
<li><code>--bbox MINX MINY MAXX MAXY</code>: restrict to specified bounding box.</li>
<li>
<code>--near X Y</code>: This option is a good replacement of <code>--bbox</code>, to used with
<code>--time</code> or <code>--test</code> and <code>--zoom</code>, implies <code>--no-geom</code>. It
automatically measure a bbox around the X Y position that corresponds to the metatiles.
</li>
<li><code>--test N</code>: test with generating N tiles.</li>
</ul>
<h4><code>generate-controller --generate-legend-images</code></h4>
<p>Generate the legend images.</p>
%endif

<script
src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.7.1/jquery.min.js"
integrity="sha512-v2CJ7UaYy4JwqLDIrZUI/4hqeoQieOmAZNXBeQyjo21dadnwR+8ZaIJVT8EE2iyI61OV8e6M8PP2/4hpQINQ/g=="
Expand Down
Binary file modified tilecloud_chain/tests/index.expected.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion tilecloud_chain/tests/test_ui.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ def test_should_not_commit():
[
pytest.param("http://application:8080/admin/", "not-login", 250, 800, id="not-login"),
pytest.param("http://application:8080/admin/test", "test", 800, 800, id="test-not-login"),
pytest.param("http://app_test_user:8080/admin", "index", 1000, 1000, id="index"),
pytest.param("http://app_test_user:8080/admin", "index", 1250, 1000, id="index"),
pytest.param("http://app_test_user:8080/admin/test", "test", 800, 800, id="test"),
],
)
Expand Down

0 comments on commit 83657d2

Please sign in to comment.