geonode.geoserver.ows
Attributes
Functions
|
Prepare namespaces dict for running xpath queries. |
|
|
|
This utility method uses the GeoNode Proxy to fetch the "DescribeCoverage". |
|
Utility method that generates a "GetCoverage" URL with fixed parameters, such as "axisLabels". |
|
Creates the WCS GetCoverage Default download links. |
|
|
|
|
|
|
|
Module Contents
- geonode.geoserver.ows._get_nsmap(original: Dict, key: str)[source]
Prepare namespaces dict for running xpath queries.
lxml complains when a namespaces dict has an entry with None as a key.
- geonode.geoserver.ows._get_wcs_axis_labels(coverage_id)[source]
This utility method uses the GeoNode Proxy to fetch the “DescribeCoverage”. The result is used to retrieve the “Envelope” and “axisLabels” that the WCS declares according to the provided “outputCrs”.
The response will look similar to the following:
<?xml version="1.0" encoding="UTF-8"?> <wcs:CoverageDescriptions xmlns:wcs="http://www.opengis.net/wcs/2.0" xmlns:ows="http://www.opengis.net/ows/2.0" xmlns:gml="http://www.opengis.net/gml/3.2" xmlns:gmlcov="http://www.opengis.net/gmlcov/1.0" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:swe="http://www.opengis.net/swe/2.0" xmlns:wcsgs="http://www.geoserver.org/wcsgs/2.0" xsi:schemaLocation=" http://www.opengis.net/wcs/2.0 http://schemas.opengis.net/wcs/2.0/wcsDescribeCoverage.xsd http://www.geoserver.org/wcsgs/2.0 http://localhost:8080/geoserver/schemas/wcs/2.0/wcsgs.xsd"> <wcs:CoverageDescription gml:id="geonode__gebco_2020_n54_0659179519862_s51_64453104883433_w0_5559082031249998_e4_409911975264549"> <gml:description>Generated from WorldImage</gml:description> <gml:name>gebco_2020_n54.0659179519862_s51.64453104883433_w0.5559082031249998_e4.409911975264549</gml:name> <gml:boundedBy> <gml:Envelope srsName="http://www.opengis.net/def/crs/EPSG/0/404000" axisLabels="x y" uomLabels="m m" srsDimension="2"> <gml:lowerCorner>-0.5 -0.5</gml:lowerCorner> <gml:upperCorner>580.5 924.5</gml:upperCorner> </gml:Envelope> </gml:boundedBy> <wcs:CoverageId>geonode__gebco_2020_n54_0659179519862_s51_64453104883433_w0_5559082031249998_e4_409911975264549</wcs:CoverageId> <gml:coverageFunction> <gml:GridFunction> <gml:sequenceRule axisOrder="+2 +1">Linear</gml:sequenceRule> <gml:startPoint>0 0</gml:startPoint> </gml:GridFunction> </gml:coverageFunction> <gmlcov:metadata> <gmlcov:Extension> <ows:Keywords> <ows:Keyword>gebco_2020_n54.0659179519862_s51.64453104883433_w0.5559082031249998_e4.409911975264549</ows:Keyword> <ows:Keyword>WCS</ows:Keyword> <ows:Keyword>WorldImage</ows:Keyword> </ows:Keywords> <ows:Metadata xlink:type="simple" xlink:href="..." /> <ows:Metadata xlink:type="simple" xlink:href="..." /> <ows:Metadata xlink:type="simple" xlink:href="..." /> <ows:Metadata xlink:type="simple" xlink:href="..." /> <ows:Metadata xlink:type="simple" xlink:href="..." /> <ows:Metadata xlink:type="simple" xlink:href="..." /> <ows:Metadata xlink:type="simple" xlink:href="http://localhost:8000/showmetadata/xsl/42" /> </gmlcov:Extension> </gmlcov:metadata> <gml:domainSet> <gml:RectifiedGrid gml:id="grid00__geonode__gebco_2020_n54_0659179519862_s51_64453104883433_w0_5559082031249998_e4_409911975264549" dimension="2"> <gml:limits> <gml:GridEnvelope> <gml:low>0 0</gml:low> <gml:high>924 580</gml:high> </gml:GridEnvelope> </gml:limits> <gml:axisLabels>i j</gml:axisLabels> <gml:origin> <gml:Point gml:id="p00_geonode__gebco_2020_n54_0659179519862_s51_64453104883433_w0_5559082031249998_e4_409911975264549" srsName="http://www.opengis.net/def/crs/EPSG/0/404000"> <gml:pos>0.0 0.0</gml:pos> </gml:Point> </gml:origin> <gml:offsetVector srsName="http://www.opengis.net/def/crs/EPSG/0/404000">0.0 1.0</gml:offsetVector> <gml:offsetVector srsName="http://www.opengis.net/def/crs/EPSG/0/404000">1.0 0.0</gml:offsetVector> </gml:RectifiedGrid> </gml:domainSet> <gmlcov:rangeType> <swe:DataRecord> <swe:field name="GRAY_INDEX"> <swe:Quantity> <swe:description>GRAY_INDEX</swe:description> <swe:uom code="W.m-2.Sr-1" /> <swe:constraint> <swe:AllowedValues> <swe:interval>0 65535</swe:interval> </swe:AllowedValues> </swe:constraint> </swe:Quantity> </swe:field> </swe:DataRecord> </gmlcov:rangeType> <wcs:ServiceParameters> <wcs:CoverageSubtype>RectifiedGridCoverage</wcs:CoverageSubtype> <wcs:nativeFormat>image/tiff</wcs:nativeFormat> </wcs:ServiceParameters> </wcs:CoverageDescription> </wcs:CoverageDescriptions>
- geonode.geoserver.ows._wcs_link(wcs_url, identifier, mime, srid=None, bbox=None, compression=None, tile_size=None)[source]
Utility method that generates a “GetCoverage” URL with fixed parameters, such as “axisLabels”.
Example URL:
http://localhost:8080/geoserver/ows? service=WCS& request=GetCoverage& coverageid=geonode__relief_san_andres0& format=image%2Ftiff& version=2.0.1& compression=DEFLATE& tileWidth=512& tileHeight=512& outputCrs=EPSG%3A4326& subset=Long(-84.0,-78.0)& subset=Lat(11.0,15.0)
- geonode.geoserver.ows.wcs_links(wcs_url, identifier, bbox=None, srid=None)[source]
Creates the WCS GetCoverage Default download links.
By providing ‘None’ bbox and srid, we are going to ask to the WCS to skip subsetting, i.e. output the whole coverage in the netive SRS.
Notice that the “wcs_links” method also generates 1 default “outputFormat”: - “geotiff”; GeoTIFF which will be compressed and tiled by passing to the WCS the default query params compression=’DEFLATE’ and tile_size=512
- geonode.geoserver.ows._wfs_link(wfs_url, identifier, mime, extra_params, bbox=None, srid=None)[source]