Git Product home page Git Product logo

ows.js's Introduction

#ows.js

Build Status

OGC Web Services Library for JavaScript.

This Library is based in the awesome work of Jsonix & ogc-schemas libraries.

Implemented so far

  • Basic Ows operations (ex: GetCapabilities)

  • CSW

    • GetRecords
    • GetRecordById
    • GetDomain
    • GetCapabilities (Refactored)
    • Transactions:
      • Create
      • Update
      • Delete
  • OGC Filters

    • Operators:
      • Logical Operators:
        • AND
        • OR
    • Spatial Operatos:
      • BBOX
    • Comparison
      • isLike
      • isBetween
      • isEqualTo
      • isLessThanOrEqualTo
      • isGreaterThan
      • isLessThan
      • isGreaterThanOrEqualTo
      • isNotEqualTo

Next TODOS

  • Clean Ows.js deprecated code.
  • Implement NOT operator.
  • PropertyIsNull
  • Improve Unit-Tests (Help is extremely Welcome here :D)
  • DescribeRecord

in the Future

  • WPS
  • WFS
  • SLD
  • etc...

Getting started

How to install ows.js in your project.

It is recommended to use bower, because this project depends on Jsonix and Ogc-schemas libraries.

 bower install ows.js --save

Using and configure CSW

The CSW standard strongly depends on catalogues profiles. So first you need to determine what profile you want to use and include its depencies:

####Basic CSW

Include in you project:

<script type="text/javascript" src="../bower_components/ogc-schemas/lib/OWS_1_0_0.js"></script>
<script type="text/javascript" src="../bower_components/ogc-schemas/lib/DC_1_1.js"></script>
<script type="text/javascript" src="../bower_components/ogc-schemas/lib/DCT.js"></script>
<script type="text/javascript" src="../bower_components/w3c-schemas/lib/XLink_1_0.js"></script>
<script type="text/javascript" src="../bower_components/ogc-schemas/lib/CSW_2_0_2.js"></script>
<script type="text/javascript" src="../bower_components/ogc-schemas/lib/Filter_1_1_0.js"></script>
<script type="text/javascript" src="../bower_components/ogc-schemas/lib/GML_3_1_1.js"></script>
<script type="text/javascript" src="../bower_components/ogc-schemas/lib/SMIL_2_0_Language.js"></script>
<script type="text/javascript" src="../bower_components/ogc-schemas/lib/SMIL_2_0.js"></script>

Configure CSW:

var 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'
            }
        ];

####ISO 19139 (implementation of 19115)

Include in you project:

<script type="text/javascript" src="../node_modules/ogc-schemas/lib/OWS_1_0_0.js"></script>
<script type="text/javascript" src="../node_modules/ogc-schemas/lib/DC_1_1.js"></script>
<script type="text/javascript" src="../node_modules/ogc-schemas/lib/DCT.js"></script>
<script type="text/javascript" src="../node_modules/w3c-schemas/lib/XLink_1_0.js"></script>
<script type="text/javascript" src="../node_modules/ogc-schemas/lib/CSW_2_0_2.js"></script>
<script type="text/javascript" src="../node_modules/ogc-schemas/lib/Filter_1_1_0.js"></script>
<script type="text/javascript" src="../node_modules/ogc-schemas/lib/GML_3_1_1.js"></script>
<script type="text/javascript" src="../node_modules/ogc-schemas/lib/SMIL_2_0_Language.js"></script>
<script type="text/javascript" src="../node_modules/ogc-schemas/lib/SMIL_2_0.js"></script>
<!-- ISO Profile -->
<script type="text/javascript" src="../node_modules/ogc-schemas/lib/GML_3_2_0.js"></script>
<script type="text/javascript" src="../node_modules/ogc-schemas/lib/ISO19139_GCO_20060504.js"></script>
<script type="text/javascript" src="../node_modules/ogc-schemas/lib/ISO19139_GMD_20060504.js"></script>
<script type="text/javascript" src="../node_modules/ogc-schemas/lib/ISO19139_GTS_20060504.js"></script>
<script type="text/javascript" src="../node_modules/ogc-schemas/lib/ISO19139_GSS_20060504.js"></script>
<script type="text/javascript" src="../node_modules/ogc-schemas/lib/ISO19139_GSR_20060504.js"></script>
<script type="text/javascript" src="../node_modules/ogc-schemas/lib/ISO19139_GMX_20060504.js"></script>
<script type="text/javascript" src="../node_modules/ogc-schemas/lib/ISO19139_SRV_20060504.js"></script>

Configure CSW:

var 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'
            }
        ];

Make a request

Simple

var cswConfig = ..... ; //
var csw = new Ows4js.Csw('http://youcatalogueurl/', cswConfig);

csw.GetRecords(1,10).then(function(result){
    console.log(result);
});

With a ogc-filter

var cswConfig = ..... ; //
var csw = new Ows4js.Csw('http://youcatalogueurl/', cswConfig);
 
var filter = new Ows4js.Filter().PropertyName('dc:title').isLike('%water%');
filter = filter.and(new Ows4js.Filter().PropertyName('dc:subject').isLike('%polution%'));
filter = filter.and(new Ows4js.Filter().BBOX(-80, 150, 80, -150, 'urn:x-ogc:def:crs:EPSG:6.11:4326'));


csw.GetRecords(1,10, filter).then(function(result){
    console.log(result);
});

Developer Zone

Clone de repository and install dependencies

git clone https://github.com/juanmav/ows.js.git
cd ows.js/
npm install

run the example project

grunt serve

Go to the browser and open the dev console

How to build ows.min.js

grunt dist

ows.js's People

Contributors

juanmav avatar tomkralidis avatar juanrapoport avatar

Watchers

Igor Mayer avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.