Skip to content

Commit

Permalink
Merge pull request #4818 from GeoNode/ISSUE_4772
Browse files Browse the repository at this point in the history
[Fixes #4772] Get rid of deprecated "Publish local map layers as WMS …
  • Loading branch information
Alessio Fabiani committed Sep 5, 2019
2 parents 8afb793 + 906cf54 commit 1ec49d4
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 21 deletions.
2 changes: 2 additions & 0 deletions geonode/maps/models.py
Expand Up @@ -49,6 +49,7 @@
from geonode import geoserver, qgis_server # noqa
from geonode.utils import check_ogc_backend

from deprecated import deprecated
from agon_ratings.models import OverallRating

logger = logging.getLogger("geonode.maps.models")
Expand Down Expand Up @@ -360,6 +361,7 @@ def layer_group(self):
else:
return None

@deprecated(version='2.10.1', reason="APIs have been changed on geospatial service")
def publish_layer_group(self):
"""
Publishes local map layers as WMS layer group on local OWS.
Expand Down
16 changes: 0 additions & 16 deletions geonode/maps/templates/maps/map_detail.html
Expand Up @@ -257,22 +257,6 @@ <h4>{% trans "Embed this map" %}</h4>
</li>
{% endif %}


{% if resource.is_public and "change_resourcebase" in perms_list or resource.layer_group %}
<li class="list-group-item">
<h4>{% trans "Map WMS" %}</h4>
<dl>{% if resource.layer_group %}
<dt>{% trans "WMS layer group for local map layers" %}:</dt>
<dd><em>{{ resource.layer_group.catalog.name }}</em> ({% trans "on" %} <a href="{{ resource.layer_group.ows }}?service=WMS&request=GetCapabilities">{% trans "local OWS" %}</a>)</dd>
{% endif %}</dl>
{% if "change_resourcebase" in perms_list %}
<p>{% trans "Publish local map layers as WMS layer group" %}</p>
<a id="layer-group" href="{%url "map_wms" resource.id %}" class="btn btn-default btn-md btn-block">{% trans "Publish Map WMS" %}</a>
{% endif %}
<dl id="layer-group-dl"></dl>
</li>
{% endif %}

{% include "base/_resourcebase_contact_snippet.html" %}

</ul>
Expand Down
1 change: 0 additions & 1 deletion geonode/maps/urls.py
Expand Up @@ -76,7 +76,6 @@
url(r'^(?P<mapid>[^/]+)/edit$', map_edit, name='map_edit'),
url(r'^(?P<mapid>[^/]+)/data$', map_json, name='map_json'),
url(r'^(?P<mapid>[^/]+)/wmc$', views.map_wmc, name='map_wmc'),
url(r'^(?P<mapid>[^/]+)/wms$', views.map_wms, name='map_wms'),
url(r'^(?P<mapid>[^/]+)/remove$', views.map_remove, name='map_remove'),
url(r'^(?P<mapid>[^/]+)/metadata$', views.map_metadata, name='map_metadata'),
url(r'^(?P<mapid>[^/]+)/metadata_advanced$', views.map_metadata_advanced, name='map_metadata_advanced'),
Expand Down
2 changes: 2 additions & 0 deletions geonode/maps/views.py
Expand Up @@ -74,6 +74,7 @@
from geonode.monitoring import register_event
from geonode.monitoring.models import EventType
from requests.compat import urljoin
from deprecated import deprecated

if check_ogc_backend(geoserver.BACKEND_PACKAGE):
# FIXME: The post service providing the map_status object
Expand Down Expand Up @@ -1147,6 +1148,7 @@ def map_wmc(request, mapid, template="maps/wmc.xml"):
}, content_type='text/xml')


@deprecated(version='2.10.1', reason="APIs have been changed on geospatial service")
def map_wms(request, mapid):
"""
Publish local map layers as group layer in local OWS.
Expand Down
8 changes: 4 additions & 4 deletions geonode/utils.py
Expand Up @@ -274,14 +274,14 @@ def _v(coord, x, source_srid=4326, target_srid=3857):
if source_srid == 4326 and x and abs(coord) != 180.0:
coord = coord - (round(coord / 360.0) * 360.0)
if source_srid == 4326 and target_srid != 4326:
if x and coord >= 180.0:
if x and float(coord) >= 179.999:
return 179.999
elif x and coord <= -180.0:
elif x and float(coord) <= -179.999:
return -179.999

if not x and coord >= 90.0:
if not x and float(coord) >= 89.999:
return 89.999
elif not x and coord <= -90.0:
elif not x and float(coord) <= -89.999:
return -89.999
return coord

Expand Down
2 changes: 2 additions & 0 deletions requirements.txt
Expand Up @@ -21,6 +21,8 @@ kombu==4.6.4
boto<=2.49.0
six<1.11.0 # https://github.com/benjaminp/six/issues/210
tqdm==4.35.0
Deprecated==1.2.6
wrapt==1.11.2

# Django Apps
django-allauth==0.40.0
Expand Down

0 comments on commit 1ec49d4

Please sign in to comment.