diff --git a/core/forms.py b/core/forms.py index 8eb8f78be..23b80ce09 100644 --- a/core/forms.py +++ b/core/forms.py @@ -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 diff --git a/core/models/caves.py b/core/models/caves.py index bd3546189..433ef871a 100644 --- a/core/models/caves.py +++ b/core/models/caves.py @@ -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: @@ -298,9 +297,6 @@ class Entrance(TroggleModel): letter = ce.entranceletter 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() diff --git a/core/views/prospect.py b/core/views/prospect.py index e9d3fde4b..561c6d383 100644 --- a/core/views/prospect.py +++ b/core/views/prospect.py @@ -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 diff --git a/core/views/statistics.py b/core/views/statistics.py index 7e29f5e78..6ae152173 100644 --- a/core/views/statistics.py +++ b/core/views/statistics.py @@ -286,11 +286,7 @@ def eastings(request): if ts: 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: diff --git a/parsers/caves.py b/parsers/caves.py index 91985d19b..c3d2567a2 100644 --- a/parsers/caves.py +++ b/parsers/caves.py @@ -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) diff --git a/parsers/locations.py b/parsers/locations.py index acf41b9bd..568e79b84 100644 --- a/parsers/locations.py +++ b/parsers/locations.py @@ -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: diff --git a/templates/cave.html b/templates/cave.html index 4a6e7d807..870df9581 100644 --- a/templates/cave.html +++ b/templates/cave.html @@ -186,9 +186,6 @@ {% if ent.entrance.bearings %}
| Cave | Ent slug | -tag | tag x | tag y | tag exact | exact x | exact y | tag other | other x | other y | tag | tag x | tag y | <tag other | other x | other y | {% for ent in ents %}
|---|---|---|---|---|---|---|---|---|---|---|
| @@ -45,9 +45,7 @@ th, td { | {{ent.tag_station}} | {{ent.tag_ts.x|floatformat:0}} | {{ent.tag_ts.y|floatformat:0}} | -{{ent.exact_station}} | -{{ent.tag_es.x|floatformat:0}} | -{{ent.tag_es.y|floatformat:0}} | +{{ent.other_station}} | {{ent.tag_os.x|floatformat:0}} | {{ent.tag_os.y|floatformat:0}} | diff --git a/templates/entrance_html.kml b/templates/entrance_html.kml index 902102c19..a9e50a9b5 100644 --- a/templates/entrance_html.kml +++ b/templates/entrance_html.kml @@ -33,18 +33,13 @@ {% if entrance.explorers %}