Files
expoweb/handbook/troggle/old_make_essentials.html

67 lines
4.4 KiB
HTML

<html><head><title>Old make_essentials script</title></head><body>
<style>body { background: #fff url(/images/style/bg-system.png) repeat-x 0 0 }</style>
<style>
h4 {
margin-top: 1.5em;
margin-bottom: 0;
}
p {
margin-top: 0;
margin-bottom: 0.5em;
}
</style>
<h2 id="tophead">CUCC Expedition Handbook</h2>
<h1>Old make_essentials script</h1>
<p>This is now replaced by the <a href="scriptscurrent.html#gps">much simpler 2025 process</a> which does not go back and forth between survex format and GPX format.
<p>This text is not deleted because we a re not sure whether some of it may yet be useful (July 2025).
<hr>
<h3>This is all obsolete</h3>
<p>In :loser:/gpx/ This: regenerates the surface tracks as survex files from GPS .gpx files. Also requires the gpx2survex program.
<p>We used to use the OCAML program gpx2survex but we now also have a python equivalent gpx2survex.py which is used by make_svx2.sh This is part of the make_essentials generation process.
<p>gpx2survex simplifies a track so that it is less voluminous.
<p>For the reverse process we don't need a script. For svx-to-gps we can use <var>survexport</var>: Olly says [2022]: "you shouldn't need to mess around with undocumented scripts - since 2018, you can just do:
<var>survexport --entrances all.3d essentials.gpx</var>"
<p>But that does rather rely on <var>all.3d</var> being properly generated, which troggle does not currently do reliably and automatically.
<p>Documented, by <var>man survexport, survexport --help</var>,
and in the Survex manual on <a href="https://survex.com/docs/manual/survexport.htm">survexport</a>.
<h4 id="ogr2ogr">ogr2ogr</h4>
If you need to refresh everything from scratch, e.g. if the kataster boundary data shapefile is updated (unlikley), then download <a href="https://gdal.org/en/stable/download.html">GDAL</a> which contains the ogr2ogr2 executable and can convert to gps:
<a href="https://gdal.org/en/stable/drivers/vector/gpx.html">format gpx</a>. The command line to do this is:<br>
<code>ogr2ogr -f GPX -nlt MULTILINESTRING -t_srs EPSG:4326 -s_srs EPSG:32633 boundaries.gpx 4_Teilgruppen_UTM_33_N_2021_01.shp -dsco GPX_USE_EXTENSIONS=YES
</code>
<h4 id="ocaml">convert_shx.ml</h4>
<p>Obsolete. We do not need this as we use ogr2ogr on the command line to generate the boundaries as a GPX file from the shapefile (.shp) format. This only needs to be done once.
<div style="margin-left: 5%">
<p>Unusually, this is in the <var>:loser:</var> repository, in :loser:/fixedpoints/scripts/convert_shx/
<p>We think this turns a shapefile which holds the coordinates of the 1623, 1624 boundaries into GPX. <strike>But we have mislaid the shapefile containing this vital data.</strike> We now have the shapefile again.
<p>It runs <var>ogr2ogr -f csv -lco GEOMETRY=AS_WKT outputfile inputfile</var> and then extensively post-processes the shapefile output.
It is written in OCAML. Therefore it must be Mark Shinwell's responsibility.
<p><a href="https://gdal.org/programs/ogr2ogr.html">ogr2ogr</a> is a file conversion utility.
It seems to be being run to convert CSV files into something else. The "shx" part of the name implies a
<a href="https://docs.fileformat.com/gis/shx/">shapefile index format</a>.
<p>We suspect this was part of the production process for originally making essentials.gpx, but we don't need it as we now have the boundary data in other formats.
</div>
<div class="onright">
<figure>
<a href="/expofiles/qgis_resources/gpx_publish_process.jpg">
<img src="gpx_publish_process-small.jpg" /></a>
<figcaption><br>Click for enlarged view
</figcaption>
</figure>
</div>
<p>This needs re-writing because the process is highly confusing: see the "documentation" in the diagram on the right. ALSO the 2024 process created a GPX track which was unusable in OSMand (our preferred GPS app) because it put every point into a separate <var>trkseg</var>.
<p>In :loser:/gpx/ [2024 text]
<p>Makes essentials.gpx - see <a href="../essentials.html">GPS on expo</a>.
This used to require the gpx2survex program (written in OCAML) but now doesn't (since 2023).
Get the OCAML file from GitHub <a href="https://github.com/mshinwell/gps2survex">https://github.com/mshinwell/gps2survex;</a>
<p>Read the <a href="make-essentialsREADME.txt">README</a> file in :loser:/gpx/y.
<p>Someone needs to document this and and make_svx.sh properly.
<ul>
<h4 id="surface">gpx2survex and make_svx.sh</h4>
[to be re-written ]</body></html>