2
0
mirror of https://expo.survex.com/repositories/troggle/.git synced 2024-11-25 08:41:51 +00:00

remove exact station

This commit is contained in:
Philip Sargent 2023-10-12 00:58:20 +03:00
parent 3b1fd56fe4
commit d3a7a9823a
10 changed files with 14 additions and 58 deletions

View File

@ -164,15 +164,11 @@ class EntranceForm(ModelForm):
)
tag_station = forms.CharField(
required=False,
widget=forms.TextInput(attrs={"size": "50"}), label="Tag station: Survex station id, e.g. 1623.p2023-xx-01"
)
exact_station = forms.CharField(
required=False,
widget=forms.TextInput(attrs={"size": "50"}), label="Exact station: Survex station id, e.g. 1623.2023-xx-01.2"
widget=forms.TextInput(attrs={"size": "50"}), label="Tag station: Survex station id, e.g. 1623.p2023-aa-01"
)
other_station = forms.CharField(
required=False,
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.gps2018-aa-01"
)
lat_wgs84 = forms.CharField(
@ -181,10 +177,10 @@ class EntranceForm(ModelForm):
long_wgs84 = forms.CharField(
required=False, widget=forms.TextInput(attrs={"size": "10"}), label="Longitude (WSG84) - if no other location"
)
alt = forms.CharField(required=False, label="Altitude (m)")
alt = forms.CharField(required=False, label="Altitude (m) - from GPS if you have it, but let it settle.")
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', 'easting', 'northing', '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', 'other_station', 'easting', 'northing', 'lat_wgs84', 'long_wgs84', 'alt', 'url']
class Meta:
model = Entrance

View File

@ -256,7 +256,6 @@ class Entrance(TroggleModel):
url = models.CharField(max_length=300, blank=True, null=True)
tag_station = models.TextField(blank=True, null=True)
exact_station = models.TextField(blank=True, null=True)
other_station = models.TextField(blank=True, null=True)
class Meta:
@ -299,9 +298,6 @@ class Entrance(TroggleModel):
print(f"### LETTER {letter}")
return letter
def exact_location(self):
return self.single(self.exact_station)
def other_location(self):
return self.single(self.other_station)
@ -313,12 +309,6 @@ class Entrance(TroggleModel):
return r + f"{s.x:0.0f}E {s.y:0.0f}N {s.z:0.0f}Alt"
except:
return r + f"{self.tag_station} Tag Station not in dataset"
if self.exact_station:
try:
s = SurvexStation.objects.lookup(self.exact_station)
return r + f"{s.x:0.0f}E {s.y:0.0f}N {s.z:0.0f}Alt"
except:
return r + f"{self.tag_station} Exact Station not in dataset"
if self.other_station:
try:
s = SurvexStation.objects.lookup(self.other_station)
@ -334,8 +324,6 @@ class Entrance(TroggleModel):
def best_station(self):
if self.tag_station:
return self.tag_station
if self.exact_station:
return self.exact_station
if self.other_station:
return self.other_station
@ -433,11 +421,6 @@ class Entrance(TroggleModel):
station = SurvexStation.objects.get(name = self.tag_station)
except:
pass
if self.exact_station:
try:
station = SurvexStation.objects.get(name = self.exact_station)
except:
pass
if station:
return station.latlong()

View File

@ -265,10 +265,8 @@ def prospecting_image(request, name):
E, N = e.easting, e.northing
if e.tag_station:
st = e.tag_station
elif e.exact_station:
st = e.exact_station
elif e.exact_station:
st = e.exact_station
elif e.other_station:
st = e.other_station
else:
# print(f' No tag - {e.name} ')
continue

View File

@ -287,10 +287,6 @@ def eastings(request):
e.tag_ts = SurvexStation.objects.get(name=ts)
#print(f"{e} {e.tag_ts} {e.tag_ts.lat()} {e.tag_ts.long()}")
es = e.exact_station
if es:
e.tag_es = SurvexStation.objects.get(name=es)
#print(f"{e} {e.tag_es} {e.tag_es.lat()} {e.tag_es.long()}")
os = e.other_station
if os:
@ -305,7 +301,7 @@ def eastings(request):
entrances = Entrance.objects.all()
for e in entrances:
if e.exact_station:
if e.other_station:
ents.add(e)
add_stations(e)
# if e.easting or e.northing:

View File

@ -498,7 +498,6 @@ def read_entrance(filename, ent=None):
bearings = getXMLmax1("bearings")
easting = getXMLmax1("easting")
entrance_description = getXMLmax1("entrance_description")
exact_station = getXMLmax1("exact_station")
explorers = getXMLmax1("explorers")
findability = getXMLmax1("findability")
findability_description = getXMLmax1("findability_description")
@ -524,11 +523,9 @@ def read_entrance(filename, ent=None):
ent.alt=alt[0]
ent.approach=approach[0]
ent.bearings=bearings[0]
ent.easting=easting[0]
ent.lat_wgs84=lat_wgs84[0]
ent.long_wgs84=long_wgs84[0]
ent.entrance_description=entrance_description[0]
ent.exact_station=exact_station[0]
ent.explorers=explorers[0]
ent.filename=filename
ent.findability=findability[0]
@ -538,7 +535,6 @@ def read_entrance(filename, ent=None):
ent.map_description=map_description[0]
ent.marking=marking[0]
ent.marking_comment=marking_comment[0]
ent.northing=northing[0]
ent.other_description=other_description[0]
ent.other_station=other_station[0]
ent.photo=photo[0]
@ -547,7 +543,7 @@ def read_entrance(filename, ent=None):
ent.underground_description=underground_description[0]
ent.url=url[0]
for st in [ent.exact_station, ent.other_station, ent.tag_station]:
for st in [ent.other_station, ent.tag_station]:
#validate_station(st)
try:
validate_station(st)

View File

@ -54,7 +54,7 @@ class MapLocations(object):
def points(self):
prior = len(self.p)
for ent in Entrance.objects.all():
for st, ent_type in {ent.exact_station: "exact", ent.other_station: "other", ent.tag_station: "tag"}.items():
for st, ent_type in {ent.other_station: "other", ent.tag_station: "tag"}.items():
if st != "":
self.p.append((st, str(ent), ent.needs_surface_work(), ent))
store_data_issues()
@ -102,7 +102,7 @@ def validate_entrance_stations(ent=None):
else:
print(f"BUGGER {ent} {ent.cavelist()}")
url="/caves"
for st, ent_type in {ent.exact_station: "exact", ent.other_station: "other", ent.tag_station: "tag"}.items():
for st, ent_type in {ent.other_station: "other", ent.tag_station: "tag"}.items():
if st == "":
continue
try:

View File

@ -186,9 +186,6 @@
{% if ent.entrance.bearings %}
<dt>Bearings</dt><dd>{{ ent.entrance.bearings|safe }}</dd>
{% endif %}
{% if ent.entrance.exact_station %}
<dt>Exact Station</dt><dd>{{ ent.entrance.exact_station|safe }}<a href="https://www.openstreetmap.org/?mlat={{ ent.entrance.exact_location.latlong.0}}&mlon={{ent.entrance.exact_location.latlong.1}}"> {{ ent.entrance.exact_location.latlong.0|floatformat:7 }}N {{ ent.entrance.exact_location.latlong.1|floatformat:7 }}E</a> (UTM33 {{ ent.entrance.exact_location.x|floatformat:0 }}, {{ ent.entrance.exact_location.y|floatformat:0 }}), {{ ent.entrance.exact_location.z|floatformat:0 }}m</dd>
{% endif %}
{% if ent.entrance.other_station %}
<dt>Other Station</dt><dd>{{ ent.entrance.other_station|safe }}
{% if ent.entrance.other_description %}

View File

@ -47,12 +47,9 @@ though, you do not need to do a data import as it happens automatically -->
<findability>{{ entrance.findability|default_if_none:""|safe }}</findability>
<findability_description>{{ entrance.findability_description|default_if_none:""|safe }}</findability_description>
<alt>{{ entrance.alt|default_if_none:""|safe }}</alt>
<northing>{{ entrance.northing|default_if_none:""|safe }}</northing>
<easting>{{ entrance.easting|default_if_none:""|safe }}</easting>
<lat_wgs84>{{ entrance.lat_wgs84|default_if_none:""|safe }}</lat_wgs84>
<long_wgs84>{{ entrance.long_wgs84|default_if_none:""|safe }}</long_wgs84>
<tag_station>{{ entrance.tag_station|default_if_none:""|safe }}</tag_station>
<exact_station>{{ entrance.exact_station|default_if_none:""|safe }}</exact_station>
<other_station>{{ entrance.other_station|default_if_none:""|safe }}</other_station>
<other_description>{{ entrance.other_description|default_if_none:""|safe }}</other_description>
<bearings>{{ entrance.bearings|default_if_none:""|safe }}</bearings>

View File

@ -28,7 +28,7 @@ th, td {
<table>
<tr><th>Cave</th><th>Ent slug</th>
<th>tag</th><th>tag x</th><th>tag y</th><th>tag exact</th><th>exact x</th><th>exact y</th><th>tag other</th><th>other x</th><th>other y</th></tr>
<th>tag</th><th>tag x</th><th>tag y</th><<th>tag other</th><th>other x</th><th>other y</th></tr>
{% for ent in ents %}
<tr>
<td style="text-align:left">
@ -45,9 +45,7 @@ th, td {
<td style="text-align:right">{{ent.tag_station}}</td>
<td style="text-align:right">{{ent.tag_ts.x|floatformat:0}}</td>
<td style="text-align:right">{{ent.tag_ts.y|floatformat:0}}</td>
<td style="text-align:right">{{ent.exact_station}}</td>
<td style="text-align:right">{{ent.tag_es.x|floatformat:0}}</td>
<td style="text-align:right">{{ent.tag_es.y|floatformat:0}}</td>
<td style="text-align:right">{{ent.other_station}}</td>
<td style="text-align:right">{{ent.tag_os.x|floatformat:0}}</td>
<td style="text-align:right">{{ent.tag_os.y|floatformat:0}}</td>

View File

@ -33,18 +33,13 @@
{% if entrance.explorers %}
<dt>Explorers</dt><dd>{{ entrance.explorers|safe }}</dd>
{% endif %}
{% if entrance.northing %}
<dt>Location</dt><dd>?BMN? Northing: {{ entrance.northing|safe }}, Easting: {{ entrance.easting|safe }}, {{ entrance.alt|safe }}m</dd>
{% endif %}
{% if entrance.tag_station %}
<dt>Tag Location</dt><dd>{{ entrance.tag_station }} {{ entrance.tag.latlong.0|floatformat:5 }}N {{ entrance.tag.latlong.1|floatformat:5 }}E - UTM33 {{ entrance.tag.y|floatformat:0 }}, {{ entrance.tag.x|floatformat:0 }}, {{ entrance.tag.z|floatformat:0 }}m</dd>
{% endif %}
{% if entrance.bearings %}
<dt>Bearings</dt><dd>{{ entrance.bearings|safe }}</dd>
{% endif %}
{% if entrance.exact_station %}
<dt>Exact Station</dt><dd>{{ entrance.exact_station|safe }} {{ entrance.exact_location.latlong.0|floatformat:5 }}N {{ entrance.exact_location.latlong.1|floatformat:5 }}E - UTM33 {{ entrance.exact_location.y|floatformat:0 }}, {{ entrance.exact_location.x|floatformat:0 }}, {{ entrance.exact_location.z|floatformat:0 }}m</dd>
{% endif %}
{% if entrance.other_station %}
<dt>Other Station</dt><dd>{{ entrance.other_station|safe }}
{% if entrance.other_description %}