Last active
October 8, 2015 15:49
-
-
Save oscarfonts/efd3a20224a8fea7c37b to your computer and use it in GitHub Desktop.
UNREDD Portal - Schema proposal for layers.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"$schema":"http://json-schema.org/draft-04/schema#", | |
"definitions":{ | |
"wmsLayer-base":{ | |
"type":"object", | |
"properties":{ | |
"id":{ | |
"type":"string" | |
}, | |
"type":{ | |
"type":"string", | |
"enum":[ | |
"wms", | |
"osm", | |
"gmaps" | |
] | |
}, | |
"visible":{ | |
"type":"boolean" | |
}, | |
"legend":{ | |
"anyOf":[ | |
{ | |
"enum":[ | |
"auto" | |
] | |
}, | |
{ | |
"type":"string" | |
} | |
] | |
}, | |
"label":{ | |
"type":"string" | |
}, | |
"sourceLink":{ | |
"type":"string", | |
"format":"uri" | |
}, | |
"sourceLabel":{ | |
"type":"string" | |
} | |
}, | |
"required":[ | |
"id" | |
], | |
"dependencies":{ | |
"sourceLink":[ | |
"sourceLabel" | |
], | |
"sourceLabel":[ | |
"sourceLink" | |
], | |
"legend":[ | |
"label" | |
], | |
"label":[ | |
"legend" | |
] | |
} | |
}, | |
"wmsLayer-wmsType":{ | |
"allOf":[ | |
{ | |
"$ref":"#/definitions/wmsLayer-base" | |
}, | |
{ | |
"properties":{ | |
"type":{ | |
"enum":[ | |
"wms" | |
] | |
}, | |
"baseUrl":{ | |
"type":"string" | |
}, | |
"wmsName":{ | |
"type":"string" | |
}, | |
"imageFormat":{ | |
"type":"string", | |
"enum":[ | |
"image/png", | |
"image/png8", | |
"image/jpeg", | |
"image/gif" | |
] | |
}, | |
"queryType":{ | |
"type":"string", | |
"enum":[ | |
"wms", | |
"wfs" | |
] | |
}, | |
"queryUrl":{ | |
"type":"string" | |
}, | |
"queryGeomFieldName":{ | |
"type":"string" | |
}, | |
"queryFieldNames":{ | |
"type":"array", | |
"items":{ | |
"type":"string" | |
}, | |
"minItems":1, | |
"uniqueItems":true | |
}, | |
"queryFieldAliases":{ | |
"type":"array", | |
"items":{ | |
"type":"string" | |
}, | |
"minItems":1, | |
"uniqueItems":true | |
}, | |
"queryTimeFieldName":{ | |
"type":"string" | |
}, | |
"queryHighlightBounds":{ | |
"type":"boolean" | |
} | |
}, | |
"required":[ | |
"wmsName" | |
], | |
"dependencies":{ | |
"queryFieldNames":[ | |
"queryFieldAliases" | |
], | |
"queryFieldAliases":[ | |
"queryFieldNames" | |
] | |
} | |
} | |
] | |
}, | |
"wmsLayer-wmsType-wfsQueryType":{ | |
"allOf":[ | |
{ | |
"$ref":"#/definitions/wmsLayer-wmsType" | |
}, | |
{ | |
"properties":{ | |
"queryType":{ | |
"enum":[ | |
"wfs" | |
] | |
} | |
}, | |
"required":[ | |
"queryType", | |
"queryUrl", | |
"queryGeomFieldName", | |
"queryFieldNames", | |
"queryFieldAliases" | |
] | |
} | |
] | |
}, | |
"wmsLayer-osmType":{ | |
"allOf":[ | |
{ | |
"$ref":"#/definitions/wmsLayer-base" | |
}, | |
{ | |
"properties":{ | |
"type":{ | |
"enum":[ | |
"osm" | |
] | |
}, | |
"osmUrls":{ | |
"type":"array", | |
"items":{ | |
"type":"string", | |
"format":"uri" | |
}, | |
"minItems":1, | |
"uniqueItems":true | |
} | |
}, | |
"required":[ | |
"type", | |
"osmUrls" | |
] | |
} | |
] | |
}, | |
"wmsLayer-gmapsType":{ | |
"allOf":[ | |
{ | |
"$ref":"#/definitions/wmsLayer-base" | |
}, | |
{ | |
"properties":{ | |
"type":{ | |
"enum":[ | |
"gmaps" | |
] | |
}, | |
"gmaps-type":{ | |
"type":"string", | |
"enum":[ | |
"ROADMAP", | |
"SATELLITE", | |
"HYBRID", | |
"TERRAIN" | |
] | |
} | |
}, | |
"required":[ | |
"type", | |
"gmaps-type" | |
] | |
} | |
] | |
}, | |
"wmsLayer":{ | |
"anyOf":[ | |
{ | |
"$ref":"#/definitions/wmsLayer-wmsType" | |
}, | |
{ | |
"$ref":"#/definitions/wmsLayer-wmsType-wfsQueryType" | |
}, | |
{ | |
"$ref":"#/definitions/wmsLayer-osmType" | |
}, | |
{ | |
"$ref":"#/definitions/wmsLayer-gmapsType" | |
} | |
] | |
}, | |
"toc":{ | |
"type":"object", | |
"properties":{ | |
"id":{ | |
"type":"string" | |
}, | |
"label":{ | |
"type":"string" | |
}, | |
"infoFile":{ | |
"type":"string" | |
}, | |
"infoLink":{ | |
"type":"string", | |
"format":"uri" | |
} | |
}, | |
"required":[ | |
"id", | |
"label" | |
] | |
}, | |
"portalLayer":{ | |
"allOf":[ | |
{ | |
"$ref":"#/definitions/toc" | |
}, | |
{ | |
"properties":{ | |
"inlineLegendUrl":{ | |
"anyOf":[ | |
{ | |
"enum":[ | |
"auto" | |
] | |
}, | |
{ | |
"type":"string" | |
} | |
] | |
}, | |
"active":{ | |
"type":"boolean" | |
}, | |
"layers":{ | |
"type":"array", | |
"items":{ | |
"type":"string" | |
}, | |
"minItems":1, | |
"uniqueItems":true | |
}, | |
"timeInstances":{ | |
"type":"string" | |
}, | |
"timeStyles":{ | |
"type":"string" | |
}, | |
"date-format":{ | |
"type":"string" | |
}, | |
"feedback":{ | |
"type":"boolean" | |
} | |
}, | |
"dependencies":{ | |
"timeStyles":[ | |
"timeInstances" | |
] | |
}, | |
"required":[ | |
"layers" | |
] | |
} | |
] | |
}, | |
"group":{ | |
"allOf":[ | |
{ | |
"$ref":"#/definitions/toc" | |
}, | |
{ | |
"properties":{ | |
"items":{ | |
"type":"array", | |
"items":{ | |
"anyOf":[ | |
{ | |
"type":"string" | |
}, | |
{ | |
"$ref":"#/definitions/group" | |
} | |
] | |
}, | |
"uniqueItems":true | |
} | |
}, | |
"required":[ | |
"items" | |
] | |
} | |
] | |
} | |
}, | |
"type":"object", | |
"properties":{ | |
"default-server":{ | |
"type":"string", | |
"format":"uri" | |
}, | |
"wmsLayers":{ | |
"type":"array", | |
"items":{ | |
"$ref":"#/definitions/wmsLayer" | |
}, | |
"minItems":1, | |
"uniqueItems":true | |
}, | |
"portalLayers":{ | |
"type":"array", | |
"items":{ | |
"$ref":"#/definitions/portalLayer" | |
}, | |
"minItems":1, | |
"uniqueItems":true | |
}, | |
"groups":{ | |
"type":"array", | |
"items":{ | |
"$ref":"#/definitions/group" | |
}, | |
"minItems":1, | |
"uniqueItems":true | |
} | |
}, | |
"required":[ | |
"default-server", | |
"wmsLayers", | |
"portalLayers", | |
"groups" | |
], | |
"additionalProperties":false | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment