kartoza / QGIS

QGIS is a free, open source, cross platform (lin/win/mac) geographical information system (GIS)
http://qgis.org
GNU General Public License v2.0
0 stars 2 forks source link

Create List of Needed GeoNode API #12

Open ismailsunni opened 7 years ago

ismailsunni commented 7 years ago

We need to list all the needed GeoNode API to implement the QGIS-GeoNode Integration:

General


ref https://github.com/kartoza/geonode/issues/144

cc @timlinux @gubuntu @lucernae @myarjunar

lucernae commented 7 years ago

CMIIW, aside from QGIS related request (and styles). I think for most of these, we can get it from CSW and/or WFS, WMS.

ismailsunni commented 7 years ago

Hi @lucernae For QGIS Server backend, I am not sure we have already the implementation of the WFS / WMS (at least they are only accessed internally). For example, with Geoserver, when you can access the WFS and WMS via http://demo.geonode.org/geoserver/geonode/wfs or http://demo.geonode.org/geoserver/geonode/wms. But, it won't work for QGIS Server.

Gustry commented 7 years ago

I though we have access to the WMS : https://github.com/kartoza/geonode_qgis_server/blob/develop/geonode_qgis_server/urls.py#L60 Is-it not this one ?

ismailsunni commented 7 years ago

Accessing API

GeoServer

The result doesn't give wms or wfs url. It only gives detail_url that point to the that layer page in geonode and thumbnail_url for the thumbnail. Sample result:

{
  "meta": {
    "limit": 0,
    "offset": 0,
    "total_count": 1
  },
  "objects": [
    {
      "abstract": "No abstract provided",
      "category__gn_description": null,
      "csw_type": "dataset",
      "csw_wkt_geometry": "POLYGON((-90.85715972938966 19.218502019302726,-90.85715972938966 19.63586086972619,-90.68248947485647 19.63586086972619,-90.68248947485647 19.218502019302726,-90.85715972938966 19.218502019302726))",
      "date": "2017-03-26T11:40:10.486601",
      "detail_url": "/layers/geonode%3Apuntos_condominios",
      "distribution_description": null,
      "distribution_url": null,
      "id": 469,
      "owner__username": "admin222",
      "popular_count": 6,
      "rating": 0,
      "share_count": 0,
      "srid": "EPSG:4326",
      "supplemental_information": "No se provee información",
      "thumbnail_url": "http://demo.geonode.org/uploaded/thumbs/layer-e0b178da-1242-11e7-b375-0e23392a5c01-thumb.png",
      "title": "puntos_condominios",
      "uuid": "e0b178da-1242-11e7-b375-0e23392a5c01"
    }
  ]
}

QGISServer

Same result as GeoServer

CSW

GeoServer

Sample result from GeoNode CSW:

<csw:Record>
            <dc:identifier>a7cd67c0-ef94-11e6-92ac-0e23392a5c01</dc:identifier>
            <dc:title>mukesh_firstgate_3</dc:title>
            <dc:type>dataset</dc:type>
            <dc:subject></dc:subject>
            <dct:references scheme="OGC:WFS">http://demo.geonode.org/geoserver/geonode/wfs</dct:references>
            <dct:references scheme="OGC:WMS">http://demo.geonode.org/geoserver/geonode/wms</dct:references>
            <dct:references scheme="WWW:DOWNLOAD-1.0-http--download">http://demo.geonode.org/geoserver/wms?request=GetLegendGraphic&amp;format=image/png&amp;WIDTH=20&amp;HEIGHT=20&amp;LAYER=geonode:mukesh_firstgate_3&amp;legend_options=fontAntiAliasing:true;fontSize:12;forceLabels:on</dct:references>
            <dct:references scheme="WWW:DOWNLOAD-1.0-http--download">http://demo.geonode.org/geoserver/wms/reflect?layers=geonode:mukesh_firstgate_3&amp;width=200&amp;height=150&amp;format=image/png8</dct:references>
            <dct:references scheme="WWW:LINK-1.0-http--link">http://demo.geonode.org/layers/geonode%3Amukesh_firstgate_3</dct:references>
            <dct:references scheme="WWW:DOWNLOAD-1.0-http--download">http://demo.geonode.org/geoserver/gwc/service/gmaps?layers=geonode:mukesh_firstgate_3&amp;zoom={z}&amp;x={x}&amp;y={y}&amp;format=image/png8</dct:references>
            <dct:references scheme="WWW:DOWNLOAD-1.0-http--download">http://demo.geonode.org/geoserver/wms/kml?layers=geonode%3Amukesh_firstgate_3&amp;mode=refresh</dct:references>
            <dct:references scheme="WWW:DOWNLOAD-1.0-http--download">http://demo.geonode.org/geoserver/wms/kml?layers=geonode%3Amukesh_firstgate_3&amp;mode=download</dct:references>
            <dct:references scheme="WWW:DOWNLOAD-1.0-http--download">http://demo.geonode.org/geoserver/wfs?srsName=EPSG%3A4326&amp;typename=geonode%3Amukesh_firstgate_3&amp;outputFormat=json&amp;version=1.0.0&amp;service=WFS&amp;request=GetFeature</dct:references>
            <dct:references scheme="WWW:DOWNLOAD-1.0-http--download">http://demo.geonode.org/geoserver/wfs?typename=geonode%3Amukesh_firstgate_3&amp;outputFormat=excel&amp;version=1.0.0&amp;request=GetFeature&amp;service=WFS</dct:references>
            <dct:references scheme="WWW:DOWNLOAD-1.0-http--download">http://demo.geonode.org/geoserver/wfs?typename=geonode%3Amukesh_firstgate_3&amp;outputFormat=csv&amp;version=1.0.0&amp;request=GetFeature&amp;service=WFS</dct:references>
            <dct:references scheme="WWW:DOWNLOAD-1.0-http--download">http://demo.geonode.org/geoserver/wfs?typename=geonode%3Amukesh_firstgate_3&amp;outputFormat=text%2Fxml%3B+subtype%3Dgml%2F3.1.1&amp;version=1.0.0&amp;request=GetFeature&amp;service=WFS</dct:references>
            <dct:references scheme="WWW:DOWNLOAD-1.0-http--download">http://demo.geonode.org/geoserver/wfs?typename=geonode%3Amukesh_firstgate_3&amp;outputFormat=gml2&amp;version=1.0.0&amp;request=GetFeature&amp;service=WFS</dct:references>
            <dct:references scheme="WWW:DOWNLOAD-1.0-http--download">http://demo.geonode.org/geoserver/wfs?format_options=charset%3AUTF-8&amp;typename=geonode%3Amukesh_firstgate_3&amp;outputFormat=SHAPE-ZIP&amp;version=1.0.0&amp;service=WFS&amp;request=GetFeature</dct:references>
            <dct:references scheme="WWW:DOWNLOAD-1.0-http--download">http://demo.geonode.org/geoserver/wms?layers=geonode%3Amukesh_firstgate_3&amp;width=550&amp;bbox=0.0%2C0.0%2C-1.0%2C-1.0&amp;service=WMS&amp;format=image%2Fpng&amp;srs=EPSG%3A4326&amp;request=GetMap&amp;height=550</dct:references>
            <dct:references scheme="WWW:DOWNLOAD-1.0-http--download">http://demo.geonode.org/geoserver/wms?layers=geonode%3Amukesh_firstgate_3&amp;width=550&amp;bbox=0.0%2C0.0%2C-1.0%2C-1.0&amp;service=WMS&amp;format=application%2Fpdf&amp;srs=EPSG%3A4326&amp;request=GetMap&amp;height=550</dct:references>
            <dct:references scheme="WWW:DOWNLOAD-1.0-http--download">http://demo.geonode.org/geoserver/wms?layers=geonode%3Amukesh_firstgate_3&amp;width=550&amp;bbox=0.0%2C0.0%2C-1.0%2C-1.0&amp;service=WMS&amp;format=image%2Fjpeg&amp;srs=EPSG%3A4326&amp;request=GetMap&amp;height=550</dct:references>
            <dct:modified>2017-02-10</dct:modified>
            <dct:abstract>No abstract provided</dct:abstract>
            <dc:date>2017-02-10</dc:date>
            <dc:language>eng</dc:language>
            <ows:BoundingBox crs="urn:x-ogc:def:crs:EPSG:6.11:4326" dimensions="2">
                <ows:LowerCorner>-1.0 -1.0</ows:LowerCorner>
                <ows:UpperCorner>0.0 0.0</ows:UpperCorner>
            </ows:BoundingBox>
        </csw:Record>

There is URL for WFS and WMS from the geoserver.

QGIS Server

Accessing this: QGIS Server GeoNode - CSW

The result:

<csw:Record>
            <dc:identifier>b5b71426-0ebb-11e7-ba36-0242ac120008</dc:identifier>
            <dc:title>Buildings</dc:title>
            <dc:type>dataset</dc:type>
            <dc:subject>Human health and safety</dc:subject>
            <dct:references scheme="WWW:DOWNLOAD-1.0-http--download">/qgis-server/download-zip/buildings</dct:references>
            <dct:references scheme="WWW:DOWNLOAD-1.0-http--download">/qgis-server/tiles/buildings/{z}/{x}/{y}.png</dct:references>
            <dct:references scheme="WWW:DOWNLOAD-1.0-http--download">/qgis-server/legend/buildings</dct:references>
            <dct:references scheme="WWW:DOWNLOAD-1.0-http--download">/qgis-server/thumbnail/buildings</dct:references>
            <dct:modified>2017-03-22</dct:modified>
            <dct:abstract>No abstract provided</dct:abstract>
            <dc:date>2017-03-22</dc:date>
            <dc:language>eng</dc:language>
            <ows:BoundingBox crs="urn:x-ogc:def:crs:EPSG:6.11:4326" dimensions="2">
                <ows:LowerCorner>-6.18730753858 106.806451101</ows:LowerCorner>
                <ows:UpperCorner>-6.17267712705 106.825250235</ows:UpperCorner>
            </ows:BoundingBox>
        </csw:Record>

Now, it's not even WMS / WFS url.

ismailsunni commented 7 years ago

@timlinux I think for geoserver one, since the CSW and layers / maps API is completed, I can make a little work around in the QGIS side. In the table in the GeoNode connection dialog, I am thinking to create a table like this:

Name Type Title Abstract
layer_1 Layer Layer 1 blah
map 1 Map Map 1 bleh

In the bottom, there will be 2 (or more) buttons to add as WMS (for layer and map) and add as WFS (for layer).

For QGIS Server one, I think we need to make the WMS / WFS mature first. I looked again at the code that @Gustry mentioned above, it's not enough, and is being used internally only.

gubuntu commented 6 years ago

@ismailsunni please update progress in the OP and add any comments to update the status

ismailsunni commented 6 years ago

@gubuntu updated. Perhaps @lucernae can check it also, if I missed any API that has been created.

lucernae commented 6 years ago

For Geonode version, in the layers response meta, there will be geonode_version

{
    "geonode_version": "2.7.dev20170920065914",
    "meta": {
        "limit": 0,
        "offset": 0,
        "total_count": 8
    },
    ...
}