From ffb1e50e42451498533393059a10bf2961e36fd3 Mon Sep 17 00:00:00 2001 From: Ricardo Garcia Silva Date: Mon, 22 Nov 2021 13:36:19 +0000 Subject: [PATCH] Use the current `/datasets` API endpoint (#178) * Use the current `/datasets` API endpoint Additionally, use the newer `subtype` API field in order to detect a dataset's layer type * Adapt tests * Adapt tests --- src/qgis_geonode/apiclient/apiv2.py | 74 +- test/_mock_geonode.py | 14 +- .../layer_detail_response1.json | 4 +- .../layer_list_filtered_response1.json | 276 +++--- .../layer_list_response1.json | 887 +++++++++--------- 5 files changed, 644 insertions(+), 611 deletions(-) diff --git a/src/qgis_geonode/apiclient/apiv2.py b/src/qgis_geonode/apiclient/apiv2.py index a2b7188b..ec4ea88c 100644 --- a/src/qgis_geonode/apiclient/apiv2.py +++ b/src/qgis_geonode/apiclient/apiv2.py @@ -53,7 +53,7 @@ def get_search_result_identifier( def get_layers_url_endpoint( self, search_params: models.GeonodeApiSearchParameters ) -> QtCore.QUrl: - url = QtCore.QUrl(f"{self.api_url}/layers/") + url = QtCore.QUrl(f"{self.api_url}/datasets/") query = self._build_search_query(search_params) url.setQuery(query.query()) return url @@ -117,9 +117,9 @@ def _build_search_query( if is_vector and is_raster: pass elif is_vector: - query.addQueryItem("filter{storeType}", "dataStore") + query.addQueryItem("filter{subtype}", "vector") elif is_raster: - query.addQueryItem("filter{storeType}", "coverageStore") + query.addQueryItem("filter{subtype}", "raster") else: raise NotImplementedError if search_params.ordering_field is not None: @@ -131,10 +131,10 @@ def _build_search_query( return query def get_layer_detail_url_endpoint(self, id_: int) -> QtCore.QUrl: - return QtCore.QUrl(f"{self.api_url}/layers/{id_}/") + return QtCore.QUrl(f"{self.api_url}/datasets/{id_}/") def get_layer_styles_url_endpoint(self, layer_id: int): - return QtCore.QUrl(f"{self.api_url}/layers/{layer_id}/styles/") + return QtCore.QUrl(f"{self.api_url}/datasets/{layer_id}/styles/") def get_maps_url_endpoint( self, @@ -150,14 +150,16 @@ def get_layer_detail_from_brief_resource( ): self.get_layer_detail(brief_resource.pk) - def deserialize_response_contents(self, contents: QtCore.QByteArray) -> typing.Dict: + def deserialize_response_contents( + self, contents: QtCore.QByteArray + ) -> typing.Optional[typing.Union[typing.List, typing.Dict]]: decoded_contents: str = contents.data().decode() try: contents = json.loads(decoded_contents) except json.JSONDecodeError as exc: log(f"decoded_contents: {decoded_contents}") log(exc, debug=False) - contents = {} + contents = None return contents # @@ -192,30 +194,36 @@ def handle_layer_list( self.network_fetcher_task.reply_content ) layers = [] - for item in deserialized.get("layers", []): - try: - brief_resource = get_brief_geonode_resource( - item, self.base_url, self.auth_config - ) - except ValueError: - log(f"Could not parse {item!r} into a valid item") - else: - layers.append(brief_resource) - pagination_info = models.GeoNodePaginationInfo( - total_records=deserialized.get("total") or 0, - current_page=deserialized.get("page") or 1, - page_size=deserialized.get("page_size") or 0, - ) + if deserialized is not None: + for item in deserialized.get("datasets", []): + try: + brief_resource = get_brief_geonode_resource( + item, self.base_url, self.auth_config + ) + except ValueError: + log(f"Could not parse {item!r} into a valid item") + else: + layers.append(brief_resource) + pagination_info = models.GeoNodePaginationInfo( + total_records=deserialized.get("total") or 0, + current_page=deserialized.get("page") or 1, + page_size=deserialized.get("page_size") or 0, + ) + else: + pagination_info = models.GeoNodePaginationInfo( + total_records=0, current_page=1, page_size=0 + ) self.layer_list_received.emit(layers, pagination_info) def handle_layer_detail(self): deserialized = self.deserialize_response_contents( self.network_fetcher_task.reply_content ) - layer = get_geonode_resource( - deserialized["layer"], self.base_url, self.auth_config - ) - self.layer_detail_received.emit(layer) + if deserialized is not None: + layer = get_geonode_resource( + deserialized["dataset"], self.base_url, self.auth_config + ) + self.layer_detail_received.emit(layer) def handle_layer_style_list(self): deserialized = self.deserialize_response_contents( @@ -321,8 +329,10 @@ def _get_common_model_fields( "spatial_extent": _get_spatial_extent(deserialized_resource["bbox_polygon"]), "crs": QgsCoordinateReferenceSystem(deserialized_resource["srid"]), "thumbnail_url": deserialized_resource["thumbnail_url"], - "api_url": (f"{geonode_base_url}/api/v2/layers/{deserialized_resource['pk']}"), - "gui_url": f"{geonode_base_url}{deserialized_resource['detail_url']}", + "api_url": ( + f"{geonode_base_url}/api/v2/datasets/{deserialized_resource['pk']}" + ), + "gui_url": deserialized_resource["detail_url"], "published_date": _get_published_date(deserialized_resource), "temporal_extent": _get_temporal_extent(deserialized_resource), "keywords": [k["name"] for k in deserialized_resource.get("keywords", [])], @@ -346,14 +356,14 @@ def get_brief_geonode_style(deserialized_style: typing.Dict, geonode_base_url: s def _get_resource_type( payload: typing.Dict, ) -> typing.Optional[models.GeonodeResourceType]: - resource_type = payload["resource_type"] + resource_type = payload.get("resource_type") if resource_type == "map": result = models.GeonodeResourceType.MAP - elif resource_type == "layer": + elif resource_type == "dataset": result = { - "coverageStore": models.GeonodeResourceType.RASTER_LAYER, - "dataStore": models.GeonodeResourceType.VECTOR_LAYER, - }.get(payload.get("storeType")) + "raster": models.GeonodeResourceType.RASTER_LAYER, + "vector": models.GeonodeResourceType.VECTOR_LAYER, + }.get(payload.get("subtype")) else: result = None return result diff --git a/test/_mock_geonode.py b/test/_mock_geonode.py index f49312ee..3eb6546e 100644 --- a/test/_mock_geonode.py +++ b/test/_mock_geonode.py @@ -13,11 +13,9 @@ ROOT = Path(__file__).parent / "_mock_geonode_data" -@geonode_flask_app.route("/api/v2/layers/") +@geonode_flask_app.route("/api/v2/datasets/") def _mock_layer_list(): - query_string = urllib.parse.unquote( - request.query_string.decode("utf-8") - ) + query_string = urllib.parse.unquote(request.query_string.decode("utf-8")) if "filter" in query_string: pattern = re.compile("filter(.*)") match = pattern.search(query_string) @@ -34,7 +32,7 @@ def _mock_layer_list(): return result -@geonode_flask_app.route("/api/v2/layers//") +@geonode_flask_app.route("/api/v2/datasets//") def _mock_layer_details(pk): data_path = ROOT / "layer_detail_response1.json" with data_path.open() as fh: @@ -42,7 +40,7 @@ def _mock_layer_details(pk): return result -@geonode_flask_app.route("/api/v2/layers//styles/") +@geonode_flask_app.route("/api/v2/datasets//styles/") def _mock_layer_styles(layer_id): data_path = ROOT / "layer_style_list_response1.json" with data_path.open() as fh: @@ -52,9 +50,7 @@ def _mock_layer_styles(layer_id): @geonode_flask_app.route("/api/v2/maps/") def _mock_map_list(): - query_string = urllib.parse.unquote( - request.query_string.decode("utf-8") - ) + query_string = urllib.parse.unquote(request.query_string.decode("utf-8")) if "filter" in query_string: pattern = re.compile("filter(.*)") match = pattern.search(query_string) diff --git a/test/_mock_geonode_data/layer_detail_response1.json b/test/_mock_geonode_data/layer_detail_response1.json index dd4c6b24..c9e238f4 100644 --- a/test/_mock_geonode_data/layer_detail_response1.json +++ b/test/_mock_geonode_data/layer_detail_response1.json @@ -1,11 +1,11 @@ { - "layer": { + "dataset": { "pk": "184", "uuid": "818898b8-5c1a-11eb-b604-0242ac150007", "name": "TEMPERATURASMINENERO2030", "workspace": "geonode", "store": "TEMPERATURASMINENERO2030", - "storeType": "coverageStore", + "subtype": "raster", "charset": "UTF-8", "is_mosaic": false, "has_time": false, diff --git a/test/_mock_geonode_data/layer_list_filtered_response1.json b/test/_mock_geonode_data/layer_list_filtered_response1.json index 8918f352..bd3266f4 100644 --- a/test/_mock_geonode_data/layer_list_filtered_response1.json +++ b/test/_mock_geonode_data/layer_list_filtered_response1.json @@ -6,140 +6,150 @@ "total": 121, "page": 1, "page_size": 2, - "layers": [{ - "pk": "184", - "uuid": "818898b8-5c1a-11eb-b604-0242ac150007", - "name": "TEMPERATURASMINENERO2030", - "workspace": "geonode", - "store": "TEMPERATURASMINENERO2030", - "storeType": "coverageStore", - "charset": "UTF-8", - "is_mosaic": false, - "has_time": false, - "has_elevation": false, - "time_regex": null, - "elevation_regex": null, - "use_featureinfo_custom_template": false, - "featureinfo_custom_template": "", - "default_style": { - "pk": 231, + "datasets": [ + { + "pk": "184", + "uuid": "818898b8-5c1a-11eb-b604-0242ac150007", "name": "TEMPERATURASMINENERO2030", "workspace": "geonode", - "sld_title": null, - "sld_body": "b'\\n\\n \\n \\n \\n \\n \\n TEMPERATURASMINENERO2030\\n \\n \\n \\n \\n \\n 1\\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n\\n'", - "sld_version": null, - "sld_url": "http://geoserver:8080/geoserver/rest/workspaces/geonode/styles/TEMPERATURASMINENERO2030.sld" - }, - "styles": [{ - "pk": 231, - "name": "TEMPERATURASMINENERO2030", - "workspace": "geonode", - "sld_title": null, - "sld_body": "b'\\n\\n \\n \\n \\n \\n \\n TEMPERATURASMINENERO2030\\n \\n \\n \\n \\n \\n 1\\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n\\n'", - "sld_version": null, - "sld_url": "http://geoserver:8080/geoserver/rest/workspaces/geonode/styles/TEMPERATURASMINENERO2030.sld" - }], - "attribute_set": [{ - "pk": 1365, - "attribute": "GRAY_INDEX", - "description": null, - "attribute_label": null, - "attribute_type": "raster", - "visible": true, - "display_order": 1, - "featureinfo_type": "type_property", - "count": 1, - "min": "NA", - "max": "NA", - "average": "NA", - "median": "NA", - "stddev": "NA", - "sum": "NA", - "unique_values": "NA", - "last_stats_updated": "2021-01-21T18:57:31.704324Z" - }], - "resource_type": "layer", - "polymorphic_ctype_id": "58", - "owner": { - "pk": 1030, - "username": "MarceloRetamalGajardo", - "first_name": "", - "last_name": "", - "avatar": "https://www.gravatar.com/avatar/f5957a6dc8bc9e00f1a6f20de9da21b6/?s=240" - }, - "poc": { - "pk": 1030, - "username": "MarceloRetamalGajardo", - "first_name": "", - "last_name": "", - "avatar": "https://www.gravatar.com/avatar/f5957a6dc8bc9e00f1a6f20de9da21b6/?s=240" - }, - "metadata_author": { - "pk": 1030, - "username": "MarceloRetamalGajardo", - "first_name": "", - "last_name": "", - "avatar": "https://www.gravatar.com/avatar/f5957a6dc8bc9e00f1a6f20de9da21b6/?s=240" - }, - "title": "TEMPERATURAS MIN ENERO 2030", - "abstract": "

No abstract provided

", - "attribution": null, - "doi": null, - "alternate": "geonode:TEMPERATURASMINENERO2030", - "date": "2021-01-21T18:57:00Z", - "date_type": "publication", - "temporal_extent_start": null, - "temporal_extent_end": null, - "edition": null, - "purpose": "", - "maintenance_frequency": null, - "constraints_other": "", - "language": "eng", - "supplemental_information": "

No se provee información

", - "data_quality_statement": "", - "bbox_polygon": { - "type": "Polygon", - "coordinates": [ - [ - [-73.8833242, -40.79168], - [-73.8833242, -39.1250132], - [-71.474990674, -39.1250132], - [-71.474990674, -40.79168], - [-73.8833242, -40.79168] + "store": "TEMPERATURASMINENERO2030", + "subtype": "raster", + "charset": "UTF-8", + "is_mosaic": false, + "has_time": false, + "has_elevation": false, + "time_regex": null, + "elevation_regex": null, + "use_featureinfo_custom_template": false, + "featureinfo_custom_template": "", + "default_style": { + "pk": 231, + "name": "TEMPERATURASMINENERO2030", + "workspace": "geonode", + "sld_title": null, + "sld_body": "b'\\n\\n \\n \\n \\n \\n \\n TEMPERATURASMINENERO2030\\n \\n \\n \\n \\n \\n 1\\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n\\n'", + "sld_version": null, + "sld_url": "http://geoserver:8080/geoserver/rest/workspaces/geonode/styles/TEMPERATURASMINENERO2030.sld" + }, + "styles": [ + { + "pk": 231, + "name": "TEMPERATURASMINENERO2030", + "workspace": "geonode", + "sld_title": null, + "sld_body": "b'\\n\\n \\n \\n \\n \\n \\n TEMPERATURASMINENERO2030\\n \\n \\n \\n \\n \\n 1\\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n\\n'", + "sld_version": null, + "sld_url": "http://geoserver:8080/geoserver/rest/workspaces/geonode/styles/TEMPERATURASMINENERO2030.sld" + } + ], + "attribute_set": [ + { + "pk": 1365, + "attribute": "GRAY_INDEX", + "description": null, + "attribute_label": null, + "attribute_type": "raster", + "visible": true, + "display_order": 1, + "featureinfo_type": "type_property", + "count": 1, + "min": "NA", + "max": "NA", + "average": "NA", + "median": "NA", + "stddev": "NA", + "sum": "NA", + "unique_values": "NA", + "last_stats_updated": "2021-01-21T18:57:31.704324Z" + } + ], + "resource_type": "layer", + "polymorphic_ctype_id": "58", + "owner": { + "pk": 1030, + "username": "MarceloRetamalGajardo", + "first_name": "", + "last_name": "", + "avatar": "https://www.gravatar.com/avatar/f5957a6dc8bc9e00f1a6f20de9da21b6/?s=240" + }, + "poc": { + "pk": 1030, + "username": "MarceloRetamalGajardo", + "first_name": "", + "last_name": "", + "avatar": "https://www.gravatar.com/avatar/f5957a6dc8bc9e00f1a6f20de9da21b6/?s=240" + }, + "metadata_author": { + "pk": 1030, + "username": "MarceloRetamalGajardo", + "first_name": "", + "last_name": "", + "avatar": "https://www.gravatar.com/avatar/f5957a6dc8bc9e00f1a6f20de9da21b6/?s=240" + }, + "title": "TEMPERATURAS MIN ENERO 2030", + "abstract": "

No abstract provided

", + "attribution": null, + "doi": null, + "alternate": "geonode:TEMPERATURASMINENERO2030", + "date": "2021-01-21T18:57:00Z", + "date_type": "publication", + "temporal_extent_start": null, + "temporal_extent_end": null, + "edition": null, + "purpose": "", + "maintenance_frequency": null, + "constraints_other": "", + "language": "eng", + "supplemental_information": "

No se provee información

", + "data_quality_statement": "", + "bbox_polygon": { + "type": "Polygon", + "coordinates": [ + [ + [-73.8833242, -40.79168], + [-73.8833242, -39.1250132], + [-71.474990674, -39.1250132], + [-71.474990674, -40.79168], + [-73.8833242, -40.79168] + ] ] - ] - }, - "srid": "EPSG:4326", - "group": null, - "popular_count": "2", - "share_count": "0", - "rating": "0", - "featured": false, - "is_published": true, - "is_approved": true, - "thumbnail_url": "https://master.demo.geonode.org/static/thumbs/layer-818898b8-5c1a-11eb-b604-0242ac150007-thumb.15fffae196e4.png?v=885131f3", - "detail_url": "/layers/TEMPERATURASMINENERO2030:geonode:TEMPERATURASMINENERO2030", - "created": "2021-01-21T18:57:27.717853Z", - "last_updated": "2021-01-21T19:19:49.765237Z", - "keywords": [{ - "name": "GeoTIFF", - "slug": "geotiff" - }, { - "name": "TEMPERATURASMINENERO2030", - "slug": "temperaturasminenero2030" - }, { - "name": "WCS", - "slug": "wcs" - }], - "regions": [{ - "code": "GLO", - "name": "Global" - }], - "category": null, - "restriction_code_type": null, - "license": { - "identifier": "not_specified" - }, - "spatial_representation_type": null - }] + }, + "srid": "EPSG:4326", + "group": null, + "popular_count": "2", + "share_count": "0", + "rating": "0", + "featured": false, + "is_published": true, + "is_approved": true, + "thumbnail_url": "https://master.demo.geonode.org/static/thumbs/layer-818898b8-5c1a-11eb-b604-0242ac150007-thumb.15fffae196e4.png?v=885131f3", + "detail_url": "/layers/TEMPERATURASMINENERO2030:geonode:TEMPERATURASMINENERO2030", + "created": "2021-01-21T18:57:27.717853Z", + "last_updated": "2021-01-21T19:19:49.765237Z", + "keywords": [ + { + "name": "GeoTIFF", + "slug": "geotiff" + }, { + "name": "TEMPERATURASMINENERO2030", + "slug": "temperaturasminenero2030" + }, { + "name": "WCS", + "slug": "wcs" + } + ], + "regions": [ + { + "code": "GLO", + "name": "Global" + } + ], + "category": null, + "restriction_code_type": null, + "license": { + "identifier": "not_specified" + }, + "spatial_representation_type": null + } + ] } diff --git a/test/_mock_geonode_data/layer_list_response1.json b/test/_mock_geonode_data/layer_list_response1.json index 65fd3c80..6ce1a974 100644 --- a/test/_mock_geonode_data/layer_list_response1.json +++ b/test/_mock_geonode_data/layer_list_response1.json @@ -6,446 +6,463 @@ "total": 121, "page": 1, "page_size": 2, - "layers": [{ - "pk": "184", - "uuid": "818898b8-5c1a-11eb-b604-0242ac150007", - "name": "TEMPERATURASMINENERO2030", - "workspace": "geonode", - "store": "TEMPERATURASMINENERO2030", - "storeType": "coverageStore", - "charset": "UTF-8", - "is_mosaic": false, - "has_time": false, - "has_elevation": false, - "time_regex": null, - "elevation_regex": null, - "use_featureinfo_custom_template": false, - "featureinfo_custom_template": "", - "default_style": { - "pk": 231, + "datasets": [ + { + "pk": "184", + "uuid": "818898b8-5c1a-11eb-b604-0242ac150007", "name": "TEMPERATURASMINENERO2030", "workspace": "geonode", - "sld_title": null, - "sld_body": "b'\\n\\n \\n \\n \\n \\n \\n TEMPERATURASMINENERO2030\\n \\n \\n \\n \\n \\n 1\\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n\\n'", - "sld_version": null, - "sld_url": "http://geoserver:8080/geoserver/rest/workspaces/geonode/styles/TEMPERATURASMINENERO2030.sld" - }, - "styles": [{ - "pk": 231, - "name": "TEMPERATURASMINENERO2030", - "workspace": "geonode", - "sld_title": null, - "sld_body": "b'\\n\\n \\n \\n \\n \\n \\n TEMPERATURASMINENERO2030\\n \\n \\n \\n \\n \\n 1\\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n\\n'", - "sld_version": null, - "sld_url": "http://geoserver:8080/geoserver/rest/workspaces/geonode/styles/TEMPERATURASMINENERO2030.sld" - }], - "attribute_set": [{ - "pk": 1365, - "attribute": "GRAY_INDEX", - "description": null, - "attribute_label": null, - "attribute_type": "raster", - "visible": true, - "display_order": 1, - "featureinfo_type": "type_property", - "count": 1, - "min": "NA", - "max": "NA", - "average": "NA", - "median": "NA", - "stddev": "NA", - "sum": "NA", - "unique_values": "NA", - "last_stats_updated": "2021-01-21T18:57:31.704324Z" - }], - "resource_type": "layer", - "polymorphic_ctype_id": "58", - "owner": { - "pk": 1030, - "username": "MarceloRetamalGajardo", - "first_name": "", - "last_name": "", - "avatar": "https://www.gravatar.com/avatar/f5957a6dc8bc9e00f1a6f20de9da21b6/?s=240" - }, - "poc": { - "pk": 1030, - "username": "MarceloRetamalGajardo", - "first_name": "", - "last_name": "", - "avatar": "https://www.gravatar.com/avatar/f5957a6dc8bc9e00f1a6f20de9da21b6/?s=240" - }, - "metadata_author": { - "pk": 1030, - "username": "MarceloRetamalGajardo", - "first_name": "", - "last_name": "", - "avatar": "https://www.gravatar.com/avatar/f5957a6dc8bc9e00f1a6f20de9da21b6/?s=240" - }, - "title": "TEMPERATURAS MIN ENERO 2030", - "abstract": "

No abstract provided

", - "attribution": null, - "doi": null, - "alternate": "geonode:TEMPERATURASMINENERO2030", - "date": "2021-01-21T18:57:00Z", - "date_type": "publication", - "temporal_extent_start": null, - "temporal_extent_end": null, - "edition": null, - "purpose": "", - "maintenance_frequency": null, - "constraints_other": "", - "language": "eng", - "supplemental_information": "

No se provee información

", - "data_quality_statement": "", - "bbox_polygon": { - "type": "Polygon", - "coordinates": [ - [ - [-73.8833242, -40.79168], - [-73.8833242, -39.1250132], - [-71.474990674, -39.1250132], - [-71.474990674, -40.79168], - [-73.8833242, -40.79168] + "store": "TEMPERATURASMINENERO2030", + "subtype": "raster", + "charset": "UTF-8", + "is_mosaic": false, + "has_time": false, + "has_elevation": false, + "time_regex": null, + "elevation_regex": null, + "use_featureinfo_custom_template": false, + "featureinfo_custom_template": "", + "default_style": { + "pk": 231, + "name": "TEMPERATURASMINENERO2030", + "workspace": "geonode", + "sld_title": null, + "sld_body": "b'\\n\\n \\n \\n \\n \\n \\n TEMPERATURASMINENERO2030\\n \\n \\n \\n \\n \\n 1\\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n\\n'", + "sld_version": null, + "sld_url": "http://geoserver:8080/geoserver/rest/workspaces/geonode/styles/TEMPERATURASMINENERO2030.sld" + }, + "styles": [ + { + "pk": 231, + "name": "TEMPERATURASMINENERO2030", + "workspace": "geonode", + "sld_title": null, + "sld_body": "b'\\n\\n \\n \\n \\n \\n \\n TEMPERATURASMINENERO2030\\n \\n \\n \\n \\n \\n 1\\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n\\n'", + "sld_version": null, + "sld_url": "http://geoserver:8080/geoserver/rest/workspaces/geonode/styles/TEMPERATURASMINENERO2030.sld" + } + ], + "attribute_set": [ + { + "pk": 1365, + "attribute": "GRAY_INDEX", + "description": null, + "attribute_label": null, + "attribute_type": "raster", + "visible": true, + "display_order": 1, + "featureinfo_type": "type_property", + "count": 1, + "min": "NA", + "max": "NA", + "average": "NA", + "median": "NA", + "stddev": "NA", + "sum": "NA", + "unique_values": "NA", + "last_stats_updated": "2021-01-21T18:57:31.704324Z" + } + ], + "resource_type": "layer", + "polymorphic_ctype_id": "58", + "owner": { + "pk": 1030, + "username": "MarceloRetamalGajardo", + "first_name": "", + "last_name": "", + "avatar": "https://www.gravatar.com/avatar/f5957a6dc8bc9e00f1a6f20de9da21b6/?s=240" + }, + "poc": { + "pk": 1030, + "username": "MarceloRetamalGajardo", + "first_name": "", + "last_name": "", + "avatar": "https://www.gravatar.com/avatar/f5957a6dc8bc9e00f1a6f20de9da21b6/?s=240" + }, + "metadata_author": { + "pk": 1030, + "username": "MarceloRetamalGajardo", + "first_name": "", + "last_name": "", + "avatar": "https://www.gravatar.com/avatar/f5957a6dc8bc9e00f1a6f20de9da21b6/?s=240" + }, + "title": "TEMPERATURAS MIN ENERO 2030", + "abstract": "

No abstract provided

", + "attribution": null, + "doi": null, + "alternate": "geonode:TEMPERATURASMINENERO2030", + "date": "2021-01-21T18:57:00Z", + "date_type": "publication", + "temporal_extent_start": null, + "temporal_extent_end": null, + "edition": null, + "purpose": "", + "maintenance_frequency": null, + "constraints_other": "", + "language": "eng", + "supplemental_information": "

No se provee información

", + "data_quality_statement": "", + "bbox_polygon": { + "type": "Polygon", + "coordinates": [ + [ + [-73.8833242, -40.79168], + [-73.8833242, -39.1250132], + [-71.474990674, -39.1250132], + [-71.474990674, -40.79168], + [-73.8833242, -40.79168] + ] ] - ] - }, - "srid": "EPSG:4326", - "group": null, - "popular_count": "2", - "share_count": "0", - "rating": "0", - "featured": false, - "is_published": true, - "is_approved": true, - "thumbnail_url": "https://master.demo.geonode.org/static/thumbs/layer-818898b8-5c1a-11eb-b604-0242ac150007-thumb.15fffae196e4.png?v=885131f3", - "detail_url": "/layers/TEMPERATURASMINENERO2030:geonode:TEMPERATURASMINENERO2030", - "created": "2021-01-21T18:57:27.717853Z", - "last_updated": "2021-01-21T19:19:49.765237Z", - "keywords": [{ - "name": "GeoTIFF", - "slug": "geotiff" - }, { - "name": "TEMPERATURASMINENERO2030", - "slug": "temperaturasminenero2030" - }, { - "name": "WCS", - "slug": "wcs" - }], - "regions": [{ - "code": "GLO", - "name": "Global" - }], - "category": null, - "restriction_code_type": null, - "license": { - "identifier": "not_specified" + }, + "srid": "EPSG:4326", + "group": null, + "popular_count": "2", + "share_count": "0", + "rating": "0", + "featured": false, + "is_published": true, + "is_approved": true, + "thumbnail_url": "https://master.demo.geonode.org/static/thumbs/layer-818898b8-5c1a-11eb-b604-0242ac150007-thumb.15fffae196e4.png?v=885131f3", + "detail_url": "/layers/TEMPERATURASMINENERO2030:geonode:TEMPERATURASMINENERO2030", + "created": "2021-01-21T18:57:27.717853Z", + "last_updated": "2021-01-21T19:19:49.765237Z", + "keywords": [ + { + "name": "GeoTIFF", + "slug": "geotiff" + }, { + "name": "TEMPERATURASMINENERO2030", + "slug": "temperaturasminenero2030" + }, { + "name": "WCS", + "slug": "wcs" + } + ], + "regions": [ + { + "code": "GLO", + "name": "Global" + } + ], + "category": null, + "restriction_code_type": null, + "license": { + "identifier": "not_specified" + }, + "spatial_representation_type": null }, - "spatial_representation_type": null - }, { - "pk": "116", - "uuid": "a465ba76-5a69-11eb-8f0b-0242ac150007", - "name": "KM", - "workspace": "geonode", - "store": "geonode_master_data", - "storeType": "dataStore", - "charset": "UTF-8", - "is_mosaic": false, - "has_time": false, - "has_elevation": false, - "time_regex": null, - "elevation_regex": null, - "use_featureinfo_custom_template": false, - "featureinfo_custom_template": null, - "default_style": { - "pk": 141, + { + "pk": "116", + "uuid": "a465ba76-5a69-11eb-8f0b-0242ac150007", "name": "KM", "workspace": "geonode", - "sld_title": "KM", - "sld_body": "b'\\n\\n \\n KM\\n \\n KM\\n KM\\n \\n \\n\\n\\n \\n \\n x\\n \\n #000088\\n \\n \\n #bbbbff\\n \\n \\n 10\\n \\n\\n\\n \\n \\n \\n \\n\\n'", - "sld_version": null, - "sld_url": "http://geoserver:8080/geoserver/rest/workspaces/geonode/styles/KM.sld" - }, - "styles": [{ - "pk": 141, - "name": "KM", - "workspace": "geonode", - "sld_title": "KM", - "sld_body": "b'\\n\\n \\n KM\\n \\n KM\\n KM\\n \\n \\n\\n\\n \\n \\n x\\n \\n #000088\\n \\n \\n #bbbbff\\n \\n \\n 10\\n \\n\\n\\n \\n \\n \\n \\n\\n'", - "sld_version": null, - "sld_url": "http://geoserver:8080/geoserver/rest/workspaces/geonode/styles/KM.sld" - }], - "attribute_set": [{ - "pk": 851, - "attribute": "fid", - "description": null, - "attribute_label": null, - "attribute_type": "xsd:int", - "visible": true, - "display_order": 1, - "featureinfo_type": "type_property", - "count": 1, - "min": "NA", - "max": "NA", - "average": "NA", - "median": "NA", - "stddev": "NA", - "sum": "NA", - "unique_values": "NA", - "last_stats_updated": "2021-01-19T15:19:03.134781Z" - }, { - "pk": 852, - "attribute": "Geometry", - "description": null, - "attribute_label": null, - "attribute_type": "gml:GeometryPropertyType", - "visible": false, - "display_order": 2, - "featureinfo_type": "type_property", - "count": 1, - "min": "NA", - "max": "NA", - "average": "NA", - "median": "NA", - "stddev": "NA", - "sum": "NA", - "unique_values": "NA", - "last_stats_updated": "2021-01-19T15:19:03.139715Z" - }, { - "pk": 853, - "attribute": "name", - "description": null, - "attribute_label": null, - "attribute_type": "xsd:string", - "visible": true, - "display_order": 3, - "featureinfo_type": "type_property", - "count": 1, - "min": "NA", - "max": "NA", - "average": "NA", - "median": "NA", - "stddev": "NA", - "sum": "NA", - "unique_values": "NA", - "last_stats_updated": "2021-01-19T15:19:03.144447Z" - }, { - "pk": 854, - "attribute": "visibility", - "description": null, - "attribute_label": null, - "attribute_type": "xsd:boolean", - "visible": true, - "display_order": 4, - "featureinfo_type": "type_property", - "count": 1, - "min": "NA", - "max": "NA", - "average": "NA", - "median": "NA", - "stddev": "NA", - "sum": "NA", - "unique_values": "NA", - "last_stats_updated": "2021-01-19T15:19:03.148711Z" - }, { - "pk": 855, - "attribute": "open", - "description": null, - "attribute_label": null, - "attribute_type": "xsd:boolean", - "visible": true, - "display_order": 5, - "featureinfo_type": "type_property", - "count": 1, - "min": "NA", - "max": "NA", - "average": "NA", - "median": "NA", - "stddev": "NA", - "sum": "NA", - "unique_values": "NA", - "last_stats_updated": "2021-01-19T15:19:03.152513Z" - }, { - "pk": 856, - "attribute": "address", - "description": null, - "attribute_label": null, - "attribute_type": "xsd:string", - "visible": true, - "display_order": 6, - "featureinfo_type": "type_property", - "count": 1, - "min": "NA", - "max": "NA", - "average": "NA", - "median": "NA", - "stddev": "NA", - "sum": "NA", - "unique_values": "NA", - "last_stats_updated": "2021-01-19T15:19:03.156848Z" - }, { - "pk": 857, - "attribute": "phoneNumber", - "description": null, - "attribute_label": null, - "attribute_type": "xsd:string", - "visible": true, - "display_order": 7, - "featureinfo_type": "type_property", - "count": 1, - "min": "NA", - "max": "NA", - "average": "NA", - "median": "NA", - "stddev": "NA", - "sum": "NA", - "unique_values": "NA", - "last_stats_updated": "2021-01-19T15:19:03.161173Z" - }, { - "pk": 858, - "attribute": "description", - "description": null, - "attribute_label": null, - "attribute_type": "xsd:string", - "visible": true, - "display_order": 8, - "featureinfo_type": "type_property", - "count": 1, - "min": "NA", - "max": "NA", - "average": "NA", - "median": "NA", - "stddev": "NA", - "sum": "NA", - "unique_values": "NA", - "last_stats_updated": "2021-01-19T15:19:03.165663Z" - }, { - "pk": 859, - "attribute": "LookAt", - "description": null, - "attribute_label": null, - "attribute_type": "gml:PointPropertyType", - "visible": false, - "display_order": 9, - "featureinfo_type": "type_property", - "count": 1, - "min": "NA", - "max": "NA", - "average": "NA", - "median": "NA", - "stddev": "NA", - "sum": "NA", - "unique_values": "NA", - "last_stats_updated": "2021-01-19T15:19:03.170299Z" - }, { - "pk": 860, - "attribute": "Region", - "description": null, - "attribute_label": null, - "attribute_type": "gml:GeometryPropertyType", - "visible": false, - "display_order": 10, - "featureinfo_type": "type_property", - "count": 1, - "min": "NA", - "max": "NA", - "average": "NA", - "median": "NA", - "stddev": "NA", - "sum": "NA", - "unique_values": "NA", - "last_stats_updated": "2021-01-19T15:19:03.174530Z" - }, { - "pk": 861, - "attribute": "Folder", - "description": null, - "attribute_label": null, - "attribute_type": "xsd:string", - "visible": true, - "display_order": 11, - "featureinfo_type": "type_property", - "count": 1, - "min": "NA", - "max": "NA", - "average": "NA", - "median": "NA", - "stddev": "NA", - "sum": "NA", - "unique_values": "NA", - "last_stats_updated": "2021-01-19T15:19:03.178421Z" - }], - "resource_type": "layer", - "polymorphic_ctype_id": "58", - "owner": { - "pk": 1070, - "username": "erison.barros@ufpe.br", - "first_name": "Erison Rosa de Oliveira", - "last_name": "Barros", - "avatar": "/static/avatars/erison.barros@ufpe.br/resized/240/LOGO_UFPE.7b32b0e32442.JPG" - }, - "poc": { - "pk": 1070, - "username": "erison.barros@ufpe.br", - "first_name": "Erison Rosa de Oliveira", - "last_name": "Barros", - "avatar": "/static/avatars/erison.barros@ufpe.br/resized/240/LOGO_UFPE.7b32b0e32442.JPG" - }, - "metadata_author": { - "pk": 1070, - "username": "erison.barros@ufpe.br", - "first_name": "Erison Rosa de Oliveira", - "last_name": "Barros", - "avatar": "/static/avatars/erison.barros@ufpe.br/resized/240/LOGO_UFPE.7b32b0e32442.JPG" - }, - "title": "KM", - "abstract": "No abstract provided", - "attribution": null, - "doi": null, - "alternate": "geonode:KM", - "date": "2021-01-19T15:18:54.113268Z", - "date_type": "publication", - "temporal_extent_start": null, - "temporal_extent_end": null, - "edition": null, - "purpose": null, - "maintenance_frequency": null, - "constraints_other": null, - "language": "eng", - "supplemental_information": "Nenhuma informação fornecida", - "data_quality_statement": null, - "bbox_polygon": { - "type": "Polygon", - "coordinates": [ - [ - [-35.3055410911337, -8.07977297927951], - [-35.3055410911337, -7.52106909110532], - [-34.9901606096963, -7.52106909110532], - [-34.9901606096963, -8.07977297927951], - [-35.3055410911337, -8.07977297927951] + "store": "geonode_master_data", + "subtype": "vector", + "charset": "UTF-8", + "is_mosaic": false, + "has_time": false, + "has_elevation": false, + "time_regex": null, + "elevation_regex": null, + "use_featureinfo_custom_template": false, + "featureinfo_custom_template": null, + "default_style": { + "pk": 141, + "name": "KM", + "workspace": "geonode", + "sld_title": "KM", + "sld_body": "b'\\n\\n \\n KM\\n \\n KM\\n KM\\n \\n \\n\\n\\n \\n \\n x\\n \\n #000088\\n \\n \\n #bbbbff\\n \\n \\n 10\\n \\n\\n\\n \\n \\n \\n \\n\\n'", + "sld_version": null, + "sld_url": "http://geoserver:8080/geoserver/rest/workspaces/geonode/styles/KM.sld" + }, + "styles": [ + { + "pk": 141, + "name": "KM", + "workspace": "geonode", + "sld_title": "KM", + "sld_body": "b'\\n\\n \\n KM\\n \\n KM\\n KM\\n \\n \\n\\n\\n \\n \\n x\\n \\n #000088\\n \\n \\n #bbbbff\\n \\n \\n 10\\n \\n\\n\\n \\n \\n \\n \\n\\n'", + "sld_version": null, + "sld_url": "http://geoserver:8080/geoserver/rest/workspaces/geonode/styles/KM.sld" + } + ], + "attribute_set": [ + { + "pk": 851, + "attribute": "fid", + "description": null, + "attribute_label": null, + "attribute_type": "xsd:int", + "visible": true, + "display_order": 1, + "featureinfo_type": "type_property", + "count": 1, + "min": "NA", + "max": "NA", + "average": "NA", + "median": "NA", + "stddev": "NA", + "sum": "NA", + "unique_values": "NA", + "last_stats_updated": "2021-01-19T15:19:03.134781Z" + }, { + "pk": 852, + "attribute": "Geometry", + "description": null, + "attribute_label": null, + "attribute_type": "gml:GeometryPropertyType", + "visible": false, + "display_order": 2, + "featureinfo_type": "type_property", + "count": 1, + "min": "NA", + "max": "NA", + "average": "NA", + "median": "NA", + "stddev": "NA", + "sum": "NA", + "unique_values": "NA", + "last_stats_updated": "2021-01-19T15:19:03.139715Z" + }, { + "pk": 853, + "attribute": "name", + "description": null, + "attribute_label": null, + "attribute_type": "xsd:string", + "visible": true, + "display_order": 3, + "featureinfo_type": "type_property", + "count": 1, + "min": "NA", + "max": "NA", + "average": "NA", + "median": "NA", + "stddev": "NA", + "sum": "NA", + "unique_values": "NA", + "last_stats_updated": "2021-01-19T15:19:03.144447Z" + }, { + "pk": 854, + "attribute": "visibility", + "description": null, + "attribute_label": null, + "attribute_type": "xsd:boolean", + "visible": true, + "display_order": 4, + "featureinfo_type": "type_property", + "count": 1, + "min": "NA", + "max": "NA", + "average": "NA", + "median": "NA", + "stddev": "NA", + "sum": "NA", + "unique_values": "NA", + "last_stats_updated": "2021-01-19T15:19:03.148711Z" + }, { + "pk": 855, + "attribute": "open", + "description": null, + "attribute_label": null, + "attribute_type": "xsd:boolean", + "visible": true, + "display_order": 5, + "featureinfo_type": "type_property", + "count": 1, + "min": "NA", + "max": "NA", + "average": "NA", + "median": "NA", + "stddev": "NA", + "sum": "NA", + "unique_values": "NA", + "last_stats_updated": "2021-01-19T15:19:03.152513Z" + }, { + "pk": 856, + "attribute": "address", + "description": null, + "attribute_label": null, + "attribute_type": "xsd:string", + "visible": true, + "display_order": 6, + "featureinfo_type": "type_property", + "count": 1, + "min": "NA", + "max": "NA", + "average": "NA", + "median": "NA", + "stddev": "NA", + "sum": "NA", + "unique_values": "NA", + "last_stats_updated": "2021-01-19T15:19:03.156848Z" + }, { + "pk": 857, + "attribute": "phoneNumber", + "description": null, + "attribute_label": null, + "attribute_type": "xsd:string", + "visible": true, + "display_order": 7, + "featureinfo_type": "type_property", + "count": 1, + "min": "NA", + "max": "NA", + "average": "NA", + "median": "NA", + "stddev": "NA", + "sum": "NA", + "unique_values": "NA", + "last_stats_updated": "2021-01-19T15:19:03.161173Z" + }, { + "pk": 858, + "attribute": "description", + "description": null, + "attribute_label": null, + "attribute_type": "xsd:string", + "visible": true, + "display_order": 8, + "featureinfo_type": "type_property", + "count": 1, + "min": "NA", + "max": "NA", + "average": "NA", + "median": "NA", + "stddev": "NA", + "sum": "NA", + "unique_values": "NA", + "last_stats_updated": "2021-01-19T15:19:03.165663Z" + }, { + "pk": 859, + "attribute": "LookAt", + "description": null, + "attribute_label": null, + "attribute_type": "gml:PointPropertyType", + "visible": false, + "display_order": 9, + "featureinfo_type": "type_property", + "count": 1, + "min": "NA", + "max": "NA", + "average": "NA", + "median": "NA", + "stddev": "NA", + "sum": "NA", + "unique_values": "NA", + "last_stats_updated": "2021-01-19T15:19:03.170299Z" + }, { + "pk": 860, + "attribute": "Region", + "description": null, + "attribute_label": null, + "attribute_type": "gml:GeometryPropertyType", + "visible": false, + "display_order": 10, + "featureinfo_type": "type_property", + "count": 1, + "min": "NA", + "max": "NA", + "average": "NA", + "median": "NA", + "stddev": "NA", + "sum": "NA", + "unique_values": "NA", + "last_stats_updated": "2021-01-19T15:19:03.174530Z" + }, { + "pk": 861, + "attribute": "Folder", + "description": null, + "attribute_label": null, + "attribute_type": "xsd:string", + "visible": true, + "display_order": 11, + "featureinfo_type": "type_property", + "count": 1, + "min": "NA", + "max": "NA", + "average": "NA", + "median": "NA", + "stddev": "NA", + "sum": "NA", + "unique_values": "NA", + "last_stats_updated": "2021-01-19T15:19:03.178421Z" + } + ], + "resource_type": "layer", + "polymorphic_ctype_id": "58", + "owner": { + "pk": 1070, + "username": "erison.barros@ufpe.br", + "first_name": "Erison Rosa de Oliveira", + "last_name": "Barros", + "avatar": "/static/avatars/erison.barros@ufpe.br/resized/240/LOGO_UFPE.7b32b0e32442.JPG" + }, + "poc": { + "pk": 1070, + "username": "erison.barros@ufpe.br", + "first_name": "Erison Rosa de Oliveira", + "last_name": "Barros", + "avatar": "/static/avatars/erison.barros@ufpe.br/resized/240/LOGO_UFPE.7b32b0e32442.JPG" + }, + "metadata_author": { + "pk": 1070, + "username": "erison.barros@ufpe.br", + "first_name": "Erison Rosa de Oliveira", + "last_name": "Barros", + "avatar": "/static/avatars/erison.barros@ufpe.br/resized/240/LOGO_UFPE.7b32b0e32442.JPG" + }, + "title": "KM", + "abstract": "No abstract provided", + "attribution": null, + "doi": null, + "alternate": "geonode:KM", + "date": "2021-01-19T15:18:54.113268Z", + "date_type": "publication", + "temporal_extent_start": null, + "temporal_extent_end": null, + "edition": null, + "purpose": null, + "maintenance_frequency": null, + "constraints_other": null, + "language": "eng", + "supplemental_information": "Nenhuma informação fornecida", + "data_quality_statement": null, + "bbox_polygon": { + "type": "Polygon", + "coordinates": [ + [ + [-35.3055410911337, -8.07977297927951], + [-35.3055410911337, -7.52106909110532], + [-34.9901606096963, -7.52106909110532], + [-34.9901606096963, -8.07977297927951], + [-35.3055410911337, -8.07977297927951] + ] ] - ] - }, - "srid": "EPSG:4326", - "group": null, - "popular_count": "0", - "share_count": "0", - "rating": "0", - "featured": false, - "is_published": true, - "is_approved": true, - "thumbnail_url": "https://master.demo.geonode.org/static/thumbs/layer-a465ba76-5a69-11eb-8f0b-0242ac150007-thumb.1d7e247fa939.png", - "detail_url": "/layers/geonode_master_data:geonode:KM", - "created": "2021-01-19T15:18:54.122492Z", - "last_updated": "2021-01-19T15:19:02.336370Z", - "keywords": [], - "regions": [{ - "code": "GLO", - "name": "Global" - }], - "category": null, - "restriction_code_type": null, - "license": { - "identifier": "not_specified" - }, - "spatial_representation_type": null - }] + }, + "srid": "EPSG:4326", + "group": null, + "popular_count": "0", + "share_count": "0", + "rating": "0", + "featured": false, + "is_published": true, + "is_approved": true, + "thumbnail_url": "https://master.demo.geonode.org/static/thumbs/layer-a465ba76-5a69-11eb-8f0b-0242ac150007-thumb.1d7e247fa939.png", + "detail_url": "/layers/geonode_master_data:geonode:KM", + "created": "2021-01-19T15:18:54.122492Z", + "last_updated": "2021-01-19T15:19:02.336370Z", + "keywords": [], + "regions": [ + { + "code": "GLO", + "name": "Global" + } + ], + "category": null, + "restriction_code_type": null, + "license": { + "identifier": "not_specified" + }, + "spatial_representation_type": null + } + ] }