Name: ows.js
Owner: Open Source Geospatial Foundation
Description: OGC Web Services Library for JavaScript
Created: 2014-07-31 12:29:05.0
Updated: 2017-12-05 14:50:34.0
Pushed: 2015-09-29 21:11:06.0
Homepage: https://github.com/OSGeo/ows.js
Size: 294
Language: JavaScript
GitHub Committers
User | Most Recent Commit | # Commits |
---|
Other Committers
User | Most Recent Commit | # Commits |
---|
OGC Web Services Library for JavaScript.
This Library is based in the awesome work of Jsonix & ogc-schemas libraries.
Basic Ows operations (ex: GetCapabilities)
CSW
OGC Filters
Operators:
Spatial Operatos:
Comparison
It is recommended to use bower, because this project depends on Jsonix and Ogc-schemas libraries.
er install ows.js --save
The CSW standard strongly depends on catalogues profiles. So first you need to determine what profile you want to use and include its depencies:
Include in you project:
ipt type="text/javascript" src="../bower_components/ogc-schemas/lib/OWS_1_0_0.js"></script>
ipt type="text/javascript" src="../bower_components/ogc-schemas/lib/DC_1_1.js"></script>
ipt type="text/javascript" src="../bower_components/ogc-schemas/lib/DCT.js"></script>
ipt type="text/javascript" src="../bower_components/w3c-schemas/lib/XLink_1_0.js"></script>
ipt type="text/javascript" src="../bower_components/ogc-schemas/lib/CSW_2_0_2.js"></script>
ipt type="text/javascript" src="../bower_components/ogc-schemas/lib/Filter_1_1_0.js"></script>
ipt type="text/javascript" src="../bower_components/ogc-schemas/lib/GML_3_1_1.js"></script>
ipt type="text/javascript" src="../bower_components/ogc-schemas/lib/SMIL_2_0_Language.js"></script>
ipt type="text/javascript" src="../bower_components/ogc-schemas/lib/SMIL_2_0.js"></script>
Configure CSW:
cswConfig = [
[
OWS_1_0_0,
DC_1_1,
DCT,
XLink_1_0,
SMIL_2_0,
SMIL_2_0_Language,
GML_3_1_1,
Filter_1_1_0,
CSW_2_0_2,
GML_3_1_1
],
{
namespacePrefixes: {
'http://www.opengis.net/cat/csw/2.0.2': 'csw',
"http://www.opengis.net/ogc": 'ogc',
"http://www.opengis.net/gml": "gml",
"http://purl.org/dc/elements/1.1/":"dc",
"http://purl.org/dc/terms/":"dct"
},
mappingStyle : 'simplified'
}
];
Include in you project:
ipt type="text/javascript" src="../node_modules/ogc-schemas/lib/OWS_1_0_0.js"></script>
ipt type="text/javascript" src="../node_modules/ogc-schemas/lib/DC_1_1.js"></script>
ipt type="text/javascript" src="../node_modules/ogc-schemas/lib/DCT.js"></script>
ipt type="text/javascript" src="../node_modules/w3c-schemas/lib/XLink_1_0.js"></script>
ipt type="text/javascript" src="../node_modules/ogc-schemas/lib/CSW_2_0_2.js"></script>
ipt type="text/javascript" src="../node_modules/ogc-schemas/lib/Filter_1_1_0.js"></script>
ipt type="text/javascript" src="../node_modules/ogc-schemas/lib/GML_3_1_1.js"></script>
ipt type="text/javascript" src="../node_modules/ogc-schemas/lib/SMIL_2_0_Language.js"></script>
ipt type="text/javascript" src="../node_modules/ogc-schemas/lib/SMIL_2_0.js"></script>
ISO Profile -->
ipt type="text/javascript" src="../node_modules/ogc-schemas/lib/GML_3_2_0.js"></script>
ipt type="text/javascript" src="../node_modules/ogc-schemas/lib/ISO19139_GCO_20060504.js"></script>
ipt type="text/javascript" src="../node_modules/ogc-schemas/lib/ISO19139_GMD_20060504.js"></script>
ipt type="text/javascript" src="../node_modules/ogc-schemas/lib/ISO19139_GTS_20060504.js"></script>
ipt type="text/javascript" src="../node_modules/ogc-schemas/lib/ISO19139_GSS_20060504.js"></script>
ipt type="text/javascript" src="../node_modules/ogc-schemas/lib/ISO19139_GSR_20060504.js"></script>
ipt type="text/javascript" src="../node_modules/ogc-schemas/lib/ISO19139_GMX_20060504.js"></script>
ipt type="text/javascript" src="../node_modules/ogc-schemas/lib/ISO19139_SRV_20060504.js"></script>
Configure CSW:
cswConfig = [
[
OWS_1_0_0,
DC_1_1,
DCT,
XLink_1_0,
SMIL_2_0,
SMIL_2_0_Language,
GML_3_1_1,
Filter_1_1_0,
CSW_2_0_2,
GML_3_2_0,
ISO19139_GSS_20060504,
ISO19139_GSR_20060504,
ISO19139_GTS_20060504,
ISO19139_GMD_20060504,
ISO19139_GCO_20060504,
ISO19139_SRV_20060504
],
{
namespacePrefixes: {
"http://www.opengis.net/cat/csw/2.0.2": "csw",
"http://www.opengis.net/ogc": 'ogc',
"http://www.opengis.net/gml": "gml",
"http://purl.org/dc/elements/1.1/":"dc",
"http://purl.org/dc/terms/":"dct",
"http://www.isotc211.org/2005/gmd" : "gmd",
"http://www.isotc211.org/2005/gco" : "gco",
},
mappingStyle : 'simplified'
}
];
Simple
cswConfig = ..... ; //
csw = new Ows4js.Csw('http://youcatalogueurl/', cswConfig);
GetRecords(1,10).then(function(result){
console.log(result);
With a ogc-filter
cswConfig = ..... ; //
csw = new Ows4js.Csw('http://youcatalogueurl/', cswConfig);
filter = new Ows4js.Filter().PropertyName('dc:title').isLike('%water%');
er = filter.and(new Ows4js.Filter().PropertyName('dc:subject').isLike('%polution%'));
er = filter.and(new Ows4js.Filter().BBOX(-80, 150, 80, -150, 'urn:x-ogc:def:crs:EPSG:6.11:4326'));
GetRecords(1,10, filter).then(function(result){
console.log(result);
clone https://github.com/juanmav/ows.js.git
ws.js/
install
run the example project
t serve
Go to the browser and open the dev console
t dist