2
0
mirror of https://expo.survex.com/repositories/troggle/.git synced 2024-11-22 07:11:52 +00:00

tooling to check unevidenced locations

This commit is contained in:
Philip Sargent 2023-10-11 23:26:41 +03:00
parent 0cd527761e
commit a2bddaeb89
3 changed files with 38 additions and 66 deletions

View File

@ -175,10 +175,10 @@ class EntranceForm(ModelForm):
widget=forms.TextInput(attrs={"size": "50"}), label="Other station: Survex station id, e.g. 1623.2023-xx-01.33" widget=forms.TextInput(attrs={"size": "50"}), label="Other station: Survex station id, e.g. 1623.2023-xx-01.33"
) )
northing = forms.CharField( northing = forms.CharField(
required=False, widget=forms.TextInput(attrs={"size": "10"}), label="Northing (UTM) - from survex data" required=False, widget=forms.TextInput(attrs={"size": "10"}), label="Northing (UTM) - random shit, being expunged"
) )
easting = forms.CharField( easting = forms.CharField(
required=False, widget=forms.TextInput(attrs={"size": "10"}), label="Easting (UTM) - from survex data" required=False, widget=forms.TextInput(attrs={"size": "10"}), label="Easting (UTM) - random shit, being expunged"
) )
lat_wgs84 = forms.CharField( lat_wgs84 = forms.CharField(
required=False, widget=forms.TextInput(attrs={"size": "10"}), label="Latitude (WSG84) - if no other location" required=False, widget=forms.TextInput(attrs={"size": "10"}), label="Latitude (WSG84) - if no other location"
@ -189,7 +189,7 @@ class EntranceForm(ModelForm):
alt = forms.CharField(required=False, label="Altitude (m)") alt = forms.CharField(required=False, label="Altitude (m)")
url = forms.CharField(required=False, label="URL [usually blank]", widget=forms.TextInput(attrs={"size": "45"})) url = forms.CharField(required=False, label="URL [usually blank]", widget=forms.TextInput(attrs={"size": "45"}))
field_order = ['name', 'entrance_description', 'explorers', 'map_description', 'location_description', 'lastvisit', 'approach', 'underground_description', 'photo', 'marking_comment', 'findability_description', 'other_description', 'bearings', 'tag_station', 'exact_station', 'other_station', 'northing', 'easting', 'lat_wgs84', 'long_wgs84', 'alt', 'url'] field_order = ['name', 'entrance_description', 'explorers', 'map_description', 'location_description', 'lastvisit', 'approach', 'underground_description', 'photo', 'marking_comment', 'findability_description', 'other_description', 'bearings', 'tag_station', 'exact_station', 'other_station', 'easting', 'northing', 'lat_wgs84', 'long_wgs84', 'alt', 'url']
class Meta: class Meta:
model = Entrance model = Entrance

View File

@ -305,26 +305,39 @@ def eastings(request):
entrances = Entrance.objects.all() entrances = Entrance.objects.all()
for e in entrances: for e in entrances:
if e.easting or e.northing: if e.exact_station:
ents.add(e) ents.add(e)
add_stations(e) add_stations(e)
e.northing = float(e.northing) # if e.easting or e.northing:
e.easting = float(e.easting) # ents.add(e)
# add_stations(e)
# e.northing = float(e.northing)
# e.easting = float(e.easting)
if e.northing < 5200000: # if e.northing < 5200000:
e.bmn = True # e.bmn = True
# e.northing = e.northing + 5200000 # e.bmn_n = e.northing
e.northing = e.northing + 5198919.918 # # e.northing = e.northing + 5200000
# e.northing = e.northing + 5198919.918
#e.easting = e.easting - 36000 + 486000 # e.bmn_e = e.easting
e.easting = e.easting + 374854.63 # linear hack # #e.easting = e.easting - 36000 + 486000
# e.easting = e.easting + 374854.63 # linear hack
try: # if e.alt:
e.diffx = e.easting - e.best_station_object().x # e.alt = e.alt.replace("m","")
e.diffy = e.northing - e.best_station_object().y
e.error = sqrt(e.diffx**2 + e.diffy**2) # #print(f"{e.slug} '{e.alt}'")
except: # e.bmn_alt = e.alt
pass # else:
# e.bmn_alt = 1000
# e.pslug = e.slug.replace("1623-","x")
# try:
# e.diffx = e.easting - e.best_station_object().x
# e.diffy = e.northing - e.best_station_object().y
# e.error = sqrt(e.diffx**2 + e.diffy**2)
# except:
# pass
for e in entrances: for e in entrances:
if e.lat_wgs84 or e.long_wgs84: if e.lat_wgs84 or e.long_wgs84:

View File

@ -34,49 +34,9 @@ th, td {
padding-right: 5px; padding-right: 5px;
</style> </style>
<p>OK now for the nasty bit. Many of the older caves did not have easting & northing in UTM 33T at all, but (probably) in BMN and converting between BMN into UTM requires ellipsoids and bessel functions.. or we can just take a linear approximation, which is what I have done here:<br>
e.northingUTM = e.northingBMN + 5198919.918<br>
e.eastingUTM = e.easting + 374854.63<br>
Such converted eastings and northings are <em>in italics</em> in the table below. As you can see, some were wildly out. Well they were until I swapped teh easting/northings around and dealt with obvious typos.
<p>These magic numbers simply come from assuming that both BMN and UTM are in metres, and linear over our area, and then taking the avergage of the offsets for 5 locations, the 5 cave entrances at the bottom of this page:
<a href="http://localhost:8000/handbook/survey/coord.htm#summary">Olaf's Coordinates</a>.
<p>This horrible approximation is accruate to ~8m in the northing and ~30m in the easting.
<table>BMN
<tr><th>Cave</th><th>Entrance slug</th><th>Easting</th><th>Northing</th><th>best tag easting</th><th>best tag northing</th>
<th>&Delta; x</th>
<th>&Delta; y</th>
<th>Distance (m)</th></tr>
{% for ent in ents %}
<tr>
<td style="text-align:left">
{% for c in ent.cavelist %}
<a href="/{{c.url}}">
{% if c.official_name %}
{{c.official_name|safe}}
{% else %}
<em>{{c|safe}}</em>
{% endif %}</a><br>
{% endfor %}</td>
<td style="text-align:right">{{ent.slug}}</td>
<td style="text-align:right; {% if ent.bmn %}font-style: italic{% endif %}">{{ent.easting|floatformat:2}}</td>
<td style="text-align:right; {% if ent.bmn %}font-style: italic{% endif %}">{{ent.northing|floatformat:2}}</td>
<td style="text-align:right">{{ent.best_station_object.x|floatformat:2}}</td>
<td style="text-align:right">{{ent.best_station_object.y|floatformat:2}}</td>
<td style="text-align:right; {% if ent.bmn %}font-style: italic{% endif %}">{{ent.diffx|floatformat:0}}</td>
<td style="text-align:right; {% if ent.bmn %}font-style: italic{% endif %}">{{ent.diffy|floatformat:0}}</td>
<td style="text-align:right; {% if ent.bmn %}font-style: italic{% endif %}">{{ent.error|floatformat:0}}</td>
</tr>
{% endfor %}
</table>
<p>For Radost's tool, but remember, these are hacked-up BMN conversions, not real.<br />
{% for ent in ents %}
33T {{ent.easting|floatformat:1}} {{ent.northing|floatformat:1}} <br />
{% endfor %}
<p> <p>
{% for ent in ents %} {% for ent in ents %}
*fix x{{ent.slug}} {{ent.easting|floatformat:2}} {{ent.northing|floatformat:2}} {{ent.alt|floatformat:0}}<br /> *fix {{ent.pslug}} {{ent.bmn_e|floatformat:0}} {{ent.bmn_n|floatformat:0}} {{ent.bmn_alt|floatformat:0}}<br />
{% endfor %} {% endfor %}
<p>and what those stations are: <p>and what those stations are:
<table> <table>
@ -108,7 +68,11 @@ Such converted eastings and northings are <em>in italics</em> in the table below
<h3>and now the GPS equivalents</h3> <h3>and now the GPS equivalents</h3>
<table> <table>
<tr><th>Cave</th><th>GPS Lat</th><th>GPS Long</th><th>best Lat</th><th>best Long</th><th>tag</th><th>tag Lat</th><th>tag Long</th><th>tag exact</th><th>exact Lat</th><th>exact Long</th><th>tag other</th><th>other Lat</th><th>other Long</th></tr> <tr><th>Cave</th>
<th>Alt</th>
<th>GPS Lat</th><th>GPS Long</th>
<th>best Lat</th><th>best Long</th><th>tag</th><th>tag Lat</th><th>tag Long</th>
</tr>
{% for ent in gpsents %} {% for ent in gpsents %}
<tr> <tr>
<td style="text-align:left"> <td style="text-align:left">
@ -121,6 +85,7 @@ Such converted eastings and northings are <em>in italics</em> in the table below
{% endif %}</a><br> {% endif %}</a><br>
{% endfor %}</td> {% endfor %}</td>
<td style="text-align:right">{{ent.alt|floatformat:1}}</td>
<td style="text-align:right">{{ent.lat_wgs84|floatformat:6}}</td> <td style="text-align:right">{{ent.lat_wgs84|floatformat:6}}</td>
<td style="text-align:right">{{ent.long_wgs84|floatformat:6}}</td> <td style="text-align:right">{{ent.long_wgs84|floatformat:6}}</td>
<td style="text-align:right">{{ent.lat|floatformat:6}}</td> <td style="text-align:right">{{ent.lat|floatformat:6}}</td>
@ -128,12 +93,6 @@ Such converted eastings and northings are <em>in italics</em> in the table below
<td style="text-align:right">{{ent.tag_station}}</td> <td style="text-align:right">{{ent.tag_station}}</td>
<td style="text-align:right">{{ent.tag_ts.lat|floatformat:6}}</td> <td style="text-align:right">{{ent.tag_ts.lat|floatformat:6}}</td>
<td style="text-align:right">{{ent.tag_ts.long|floatformat:6}}</td> <td style="text-align:right">{{ent.tag_ts.long|floatformat:6}}</td>
<td style="text-align:right">{{ent.exact_station}}</td>
<td style="text-align:right">{{ent.tag_es.lat|floatformat:6}}</td>
<td style="text-align:right">{{ent.tag_es.long|floatformat:6}}</td>
<td style="text-align:right">{{ent.other_station}}</td>
<td style="text-align:right">{{ent.tag_os.lat|floatformat:6}}</td>
<td style="text-align:right">{{ent.tag_os.long|floatformat:6}}</td>
</tr> </tr>
{% endfor %} {% endfor %}
</table> </table>