class TimeExtensionDecoder(kvp.Decoder): start = kvp.Parameter(num="?", type=parse_iso8601) end = kvp.Parameter(num="?", type=parse_iso8601) relation = kvp.Parameter( num="?", type=enum(("intersects", "contains", "disjoint", "equals"), False), default="intersects")
class LayerMapperConfigReader(config.Reader): section = "services.ows.wms" limit_products = config.Option(type=int) limit_mode = config.Option(type=enum('hide', 'outlines'), default='hide') min_render_zoom = config.Option(type=int) fill_opacity = config.Option(type=float) color = config.Option(type=str, default='grey')
class GeoExtensionDecoder(kvp.Decoder): box = kvp.Parameter(num="?", type=parse_bbox) radius = kvp.Parameter(num="?", type=float) geometry = kvp.Parameter(num="?", type=GEOSGeometry) lon = kvp.Parameter(num="?", type=float) lat = kvp.Parameter(num="?", type=float) relation = kvp.Parameter(num="?", type=enum(("intersects", "contains", "disjoint"), False), default="intersects") uid = kvp.Parameter(num="?")
break yield data if delete: os.remove(filename) def pos_int(value): value = int(value) if value < 0: raise ValueError("Negative values are not allowed.") return value containment_enum = enum( ("overlaps", "contains"), False ) def parse_format(string): parts = string.split(";") params = dict( param.strip().split("=", 1) for param in parts[1:] ) return parts[0], params class WCS20GetEOCoverageSetKVPDecoder(kvp.Decoder): eo_ids = kvp.Parameter("eoid", type=typelist(str, ","), num=1, locator="eoid") subsets = kvp.Parameter("subset", type=parse_subset_kvp, num="*") containment = kvp.Parameter(type=containment_enum, num="?") count = kvp.Parameter(type=pos_int, num="?", default=sys.maxint)
class SubsetConfigReader(config.Reader): section = "services.owscommon" time_interval_interpretation = config.Option(default="closed", type=enum(("closed", "open"), False))
count_all_coverages + num_collections ), pretty_print=True ), encoder.content_type ) def pos_int(value): value = int(value) if value < 0: raise ValueError("Negative values are not allowed.") return value containment_enum = enum( ("overlaps", "contains"), False ) sections_enum = enum( ("DatasetSeriesDescriptions", "CoverageDescriptions", "All"), False ) class WCS20DescribeEOCoverageSetKVPDecoder(kvp.Decoder, SectionsMixIn): eo_ids = kvp.Parameter("eoid", type=typelist(str, ","), num=1, locator="eoid") subsets = kvp.Parameter("subset", type=parse_subset_kvp, num="*") containment = kvp.Parameter(type=containment_enum, num="?") count = kvp.Parameter(type=pos_int, num="?", default=sys.maxint) sections = kvp.Parameter(type=typelist(sections_enum, ","), num="?") class WCS20DescribeEOCoverageSetXMLDecoder(xml.Decoder, SectionsMixIn):
"geotiff:tileheight to be set.", "geotiff:tiling" ) return { "compression": compression, "jpeg_quality": jpeg_quality, "predictor": predictor, "interleave": decoder.interleave, "tiling": tiling, "tileheight": tileheight, "tilewidth": tilewidth } compression_enum = enum( ("None", "PackBits", "Huffman", "LZW", "JPEG", "Deflate"), True, CompressionInvalid ) predictor_enum = enum(("None", "Horizontal", "FloatingPoint"), True, PredictorInvalid) interleave_enum = enum(("Pixel", "Band"), True, InterleavingInvalid) def parse_multiple_16(raw): value = int(raw) if value < 0: raise ValueError("Value must be a positive integer.") elif (value % 16) != 0: raise ValueError("Value must be a multiple of 16.") return value class WCS20GeoTIFFEncodingExtensionKVPDecoder(kvp.Decoder): compression = kvp.Parameter("geotiff:compression", num="?", type=compression_enum)
class EarthObservationExtensionDecoder(kvp.Decoder): productType = kvp.Parameter(num="?", type=str) doi = kvp.Parameter(num="?", type=str) platform = kvp.Parameter(num="?", type=str) platformSerialIdentifier = kvp.Parameter(num="?", type=str) instrument = kvp.Parameter(num="?", type=str) sensorType = kvp.Parameter( num="?", type=enum(('OPTICAL', 'RADAR', 'ALTIMETRIC', 'ATMOSPHERIC', 'LIMB'), False)) compositeType = kvp.Parameter(num="?", type=str) processingLevel = kvp.Parameter(num="?", type=str) orbitType = kvp.Parameter(num="?", type=str) spectralRange = kvp.Parameter(num="?", type=str) wavelength = kvp.Parameter(num="?", type=parse_float_range) hasSecurityConstraints = kvp.Parameter(num="?", type=enum(('TRUE', 'FALSE'), False)) dissemination = kvp.Parameter(num="?", type=str) recordSchema = kvp.Parameter(num="?", type=str) parentIdentifier = kvp.Parameter(num="?", type=str) productionStatus = kvp.Parameter(num="?", type=str) acquisitionType = kvp.Parameter(num="?", type=enum( ('NOMINAL', 'CALIBRATION', 'OTHER'), False)) orbitNumber = kvp.Parameter(num="?", type=parse_int_range) orbitDirection = kvp.Parameter(num="?", type=enum(('ASCENDING', 'DESCENDING'), False)) track = kvp.Parameter(num="?", type=str) frame = kvp.Parameter(num="?", type=str) swathIdentifier = kvp.Parameter(num="?", type=str) cloudCover = kvp.Parameter(num="?", type=parse_int_range) snowCover = kvp.Parameter(num="?", type=parse_int_range) lowestLocation = kvp.Parameter(num="?", type=parse_float_range) highestLocation = kvp.Parameter(num="?", type=parse_float_range) productVersion = kvp.Parameter(num="?", type=str) productQualityStatus = kvp.Parameter(num="?", type=enum(('NOMINAL', 'DEGRADED'), False)) productQualityDegradationTag = kvp.Parameter(num="?", type=str) processorName = kvp.Parameter(num="?", type=str) processingCenter = kvp.Parameter(num="?", type=str) creationDate = kvp.Parameter(num="?", type=parse_datetime_range) modificationDate = kvp.Parameter(num="?", type=parse_datetime_range) processingDate = kvp.Parameter(num="?", type=parse_datetime_range) sensorMode = kvp.Parameter(num="?", type=str) archivingCenter = kvp.Parameter(num="?", type=str) processingMode = kvp.Parameter(num="?", type=str) availabilityTime = kvp.Parameter(num="?", type=parse_datetime_range) acquisitionStation = kvp.Parameter(num="?", type=str) acquisitionSubType = kvp.Parameter(num="?", type=str) startTimeFromAscendingNode = kvp.Parameter(num="?", type=parse_int_range) completionTimeFromAscendingNode = kvp.Parameter(num="?", type=parse_int_range) illuminationAzimuthAngle = kvp.Parameter(num="?", type=parse_float_range) illuminationZenithAngle = kvp.Parameter(num="?", type=parse_float_range) illuminationElevationAngle = kvp.Parameter(num="?", type=parse_float_range) polarisationMode = kvp.Parameter(num="?", type=enum( ('S', 'D', 'T', 'Q', 'UNDEFINED'), False)) polarizationChannels = kvp.Parameter(num="?", type=str) antennaLookDirection = kvp.Parameter(num="?", type=str) minimumIncidenceAngle = kvp.Parameter(num="?", type=parse_float_range) maximumIncidenceAngle = kvp.Parameter(num="?", type=parse_float_range) dopplerFrequency = kvp.Parameter(num="?", type=parse_float_range) incidenceAngleVariation = kvp.Parameter(num="?", type=parse_float_range)
if not data: break yield data if delete: os.remove(filename) def pos_int(value): value = int(value) if value < 0: raise ValueError("Negative values are not allowed.") return value containment_enum = enum(("overlaps", "contains"), False) def parse_format(string): parts = string.split(";") params = dict(param.strip().split("=", 1) for param in parts[1:]) return parts[0], params class WCS20GetEOCoverageSetKVPDecoder(kvp.Decoder): eo_ids = kvp.Parameter("eoid", type=typelist(str, ","), num=1, locator="eoid") subsets = kvp.Parameter("subset", type=parse_subset_kvp, num="*") containment = kvp.Parameter(type=containment_enum, num="?")
"geotiff:tileheight to be set.", "geotiff:tiling" ) return { "compression": compression, "jpeg_quality": jpeg_quality, "predictor": predictor, "interleave": decoder.interleave, "tiling": tiling, "tileheight": tileheight, "tilewidth": tilewidth } compression_enum = enum( ("None", "PackBits", "Huffman", "LZW", "JPEG", "Deflate") ) predictor_enum = enum(("None", "Horizontal", "FloatingPoint")) interleave_enum = enum(("Pixel", "Band")) def parse_multiple_16(raw): value = int(raw) if value < 0: raise ValueError("Value must be a positive integer.") elif (value % 16) != 0: raise ValueError("Value must be a multiple of 16.") return value class WCS20GeoTIFFEncodingExtensionKVPDecoder(kvp.Decoder):
number_matched=number_matched ), pretty_print=True ), encoder.content_type ) def pos_int(value): value = int(value) if value < 0: raise ValueError("Negative values are not allowed.") return value containment_enum = enum( ("overlaps", "contains"), False ) sections_enum = enum( ("DatasetSeriesDescriptions", "CoverageDescriptions", "All"), False ) class WCS20DescribeEOCoverageSetKVPDecoder(kvp.Decoder, SectionsMixIn): eo_ids = kvp.Parameter("eoid", type=typelist(str, ","), num=1, locator="eoid") subsets = kvp.Parameter("subset", type=parse_subset_kvp, num="*") containment = kvp.Parameter(type=containment_enum, num="?") count = kvp.Parameter(type=pos_int, num="?", default=MAXSIZE) sections = kvp.Parameter(type=typelist(sections_enum, ","), num="?") class WCS20DescribeEOCoverageSetXMLDecoder(xml.Decoder, SectionsMixIn):
raise InvalidParameterException( "geotiff:tiling requires geotiff:tilewidth and " "geotiff:tileheight to be set.", "geotiff:tiling") return { "compression": compression, "jpeg_quality": jpeg_quality, "predictor": predictor, "interleave": decoder.interleave, "tiling": tiling, "tileheight": tileheight, "tilewidth": tilewidth } compression_enum = enum( ("None", "PackBits", "Huffman", "LZW", "JPEG", "Deflate")) predictor_enum = enum(("None", "Horizontal", "FloatingPoint")) interleave_enum = enum(("Pixel", "Band")) def parse_multiple_16(raw): value = int(raw) if value < 0: raise ValueError("Value must be a positive integer.") elif (value % 16) != 0: raise ValueError("Value must be a multiple of 16.") return value class WCS20GeoTIFFEncodingExtensionKVPDecoder(kvp.Decoder): compression = kvp.Parameter("geotiff:compression",