Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

♻️ Refactor REST API response for: /interface/ows #601

Merged
merged 6 commits into from
Nov 17, 2023

Conversation

wlorenzetti
Copy link
Member

@wlorenzetti wlorenzetti commented Sep 20, 2023

Closes: #600

Refactoring of response fo REST API /interface/ows.

Add detailed informations about WMS service methods:

  • GetMap,
  • GetFeatureInfo
  • Getcapabilities

Example WMS Service: https://geoportale.regione.lazio.it/capabilities/capabilities/wms/layer/397/

Before (no methods):

{
  "result": true,
  "title": "GeoPortale Regione Lazio WMS",
  "abstract": "WMS Capabilities del Geoportale Regione Lazio",
  "map_formats": [
    "image/png",
    "application/atom+xml",
    "application/json;type=utfgrid",
    "application/pdf",
    "application/rss+xml",
    "application/vnd.google-earth.kml+xml",
    "application/vnd.google-earth.kml+xml;mode=networklink",
    "application/vnd.google-earth.kmz",
    "image/geotiff",
    "image/geotiff8",
    "image/gif",
    "image/jpeg",
    "image/png; mode=8bit",
    "image/svg+xml",
    "image/tiff",
    "image/tiff8",
    "image/vnd.jpeg-png",
    "image/vnd.jpeg-png8",
    "text/html; subtype=openlayers",
    "text/html; subtype=openlayers2",
    "text/html; subtype=openlayers3"
  ],
  "info_formats": [
    "text/plain",
    "application/vnd.ogc.gml",
    "text/xml",
    "application/vnd.ogc.gml/3.1.1",
    "text/xml; subtype=gml/3.1.1",
    "text/html",
    "text/javascript",
    "application/json"
  ],
  "layers": [
    {
      "name": "orso_marsicano0",
      "title": "Mappatura degli eventi di presenza dell'orso bruno marsicano",
      "abstract": "Nessun riassunto fornito",
      "crss": [
        {
          "epsg": 25833,
          "proj4": "+proj=utm +zone=33 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs",
          "geographic": false,
          "axisinverted": false,
          "extent": [
            269387.69437979034,
            5142865.884479614,
            532553.189460577,
            9375830.110660298
          ]
        },
        {
          "epsg": 3857,
          "proj4": "+proj=merc +a=6378137 +b=6378137 +lat_ts=0 +lon_0=0 +x_0=0 +y_0=0 +k=1 +units=m +nadgrids=@null +wktext +no_defs",
          "geographic": false,
          "axisinverted": false,
          "extent": [
            -20037508.342789244,
            -20048966.104014594,
            20037508.342789244,
            20048966.104014594
          ]
        },
        {
          "epsg": 4326,
          "proj4": "+proj=longlat +datum=WGS84 +no_defs",
          "geographic": true,
          "axisinverted": false,
          "extent": [
            -180,
            -90,
            180,
            90
          ]
        }
      ],
      "styles": {
        "orso_marsicano0": {
          "title": "orso_marsicano0",
          "legend": "https://geoportale.regione.lazio.it/geoserver/geonode/orso_marsicano0/ows?service=WMS&request=GetLegendGraphic&format=image%2Fpng&width=20&height=20&layer=orso_marsicano0",
          "legend_width": "20",
          "legend_height": "20",
          "legend_format": "image/png"
        }
      },
      "parent": null
    }
  ]
}

After (with methods):

{
  "result": true,
  "title": "GeoPortale Regione Lazio WMS",
  "abstract": "WMS Capabilities del Geoportale Regione Lazio",
  "methods": {
    "GetMap": {
      "formats": [
        "image/png",
        "application/atom+xml",
        "application/json;type=utfgrid",
        "application/pdf",
        "application/rss+xml",
        "application/vnd.google-earth.kml+xml",
        "application/vnd.google-earth.kml+xml;mode=networklink",
        "application/vnd.google-earth.kmz",
        "image/geotiff",
        "image/geotiff8",
        "image/gif",
        "image/jpeg",
        "image/png; mode=8bit",
        "image/svg+xml",
        "image/tiff",
        "image/tiff8",
        "image/vnd.jpeg-png",
        "image/vnd.jpeg-png8",
        "text/html; subtype=openlayers",
        "text/html; subtype=openlayers2",
        "text/html; subtype=openlayers3"
      ],
      "urls": [
        {
          "type": "Get",
          "url": "https://geoportale.regione.lazio.it/geoserver/geonode/orso_marsicano0/ows?SERVICE=WMS&"
        }
      ]
    },
    "GetFeatureInfo": {
      "formats": [
        "text/plain",
        "application/vnd.ogc.gml",
        "text/xml",
        "application/vnd.ogc.gml/3.1.1",
        "text/xml; subtype=gml/3.1.1",
        "text/html",
        "text/javascript",
        "application/json"
      ],
      "methods": [
        {
          "type": "Get",
          "url": "https://geoportale.regione.lazio.it/geoserver/geonode/orso_marsicano0/ows?SERVICE=WMS&"
        }
      ]
    },
    "GetCapabilities": {
      "formats": [
        "text/xml"
      ],
      "methods": [
        {
          "type": "Get",
          "url": "https://geoportale.regione.lazio.it/geoserver/geonode/orso_marsicano0/ows?SERVICE=WMS&"
        },
        {
          "type": "Post",
          "url": "https://geoportale.regione.lazio.it/geoserver/geonode/orso_marsicano0/ows?SERVICE=WMS&"
        }
      ]
    }
  },
  "layers": [
    {
      "name": "orso_marsicano0",
      "title": "Mappatura degli eventi di presenza dell'orso bruno marsicano",
      "abstract": "Nessun riassunto fornito",
      "crss": [
        {
          "epsg": 4326,
          "proj4": "+proj=longlat +datum=WGS84 +no_defs",
          "geographic": true,
          "axisinverted": false,
          "extent": [
            -180,
            -90,
            180,
            90
          ]
        },
        {
          "epsg": 3857,
          "proj4": "+proj=merc +a=6378137 +b=6378137 +lat_ts=0 +lon_0=0 +x_0=0 +y_0=0 +k=1 +units=m +nadgrids=@null +wktext +no_defs",
          "geographic": false,
          "axisinverted": false,
          "extent": [
            -20037508.342789244,
            -20048966.104014594,
            20037508.342789244,
            20048966.104014594
          ]
        },
        {
          "epsg": 25833,
          "proj4": "+proj=utm +zone=33 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs",
          "geographic": false,
          "axisinverted": false,
          "extent": [
            269387.69437979034,
            5142865.884479614,
            532553.189460577,
            9375830.110660298
          ]
        }
      ],
      "styles": {
        "orso_marsicano0": {
          "title": "orso_marsicano0",
          "legend": "https://geoportale.regione.lazio.it/geoserver/geonode/orso_marsicano0/ows?service=WMS&request=GetLegendGraphic&format=image%2Fpng&width=20&height=20&layer=orso_marsicano0",
          "legend_width": "20",
          "legend_height": "20",
          "legend_format": "image/png"
        }
      },
      "parent": null
    }
  ]
}

@wlorenzetti wlorenzetti added bug Something isn't working feature New feature or request labels Sep 20, 2023
@wlorenzetti wlorenzetti added this to the v3.7 milestone Sep 20, 2023
@wlorenzetti wlorenzetti self-assigned this Sep 20, 2023
@wlorenzetti
Copy link
Member Author

@volterra79 I make a refactoring of information about methods GetMap, GetFeatureInfo, GetCapabilitites. Now information about them are available inside the property methods.

# Conflicts:
#	g3w-admin/core/tests/test_api.py
@wlorenzetti wlorenzetti changed the title Refactoring response of /interface/ows API. ♻️ Refactoring response of /interface/ows API. Oct 20, 2023
@wlorenzetti wlorenzetti added the refactoring Anything which could result in a API change label Oct 20, 2023
@Raruto Raruto removed bug Something isn't working feature New feature or request labels Nov 14, 2023
@Raruto Raruto marked this pull request as ready for review November 14, 2023 15:13
@Raruto Raruto changed the title ♻️ Refactoring response of /interface/ows API. ♻️ Refactor REST API response for: /interface/ows Nov 14, 2023
…g3w-admin into wms_on_the_fly_getmap

� Conflicts:
�	g3w-admin/client/static/client/css/app.min.css
�	g3w-admin/client/static/client/js/app.min.js
@wlorenzetti wlorenzetti merged commit 6577b9d into dev Nov 17, 2023
4 checks passed
@wlorenzetti wlorenzetti deleted the wms_on_the_fly_getmap branch November 17, 2023 11:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
refactoring Anything which could result in a API change
Projects
None yet
Development

Successfully merging this pull request may close these issues.

WMS service with GetMap URL different from GetCapabilitites URL fail
3 participants