How to use wkt-parser - 4 common examples

To help you get started, we’ve selected a few wkt-parser examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github bcgov / smk / smk-parent / smk-ui / src / main / webapp / resources / js / lib / defs.js View on Github external
function defs(name) {
  /*global console*/
  var that = this;
  if (arguments.length === 2) {
    var def = arguments[1];
    if (typeof def === 'string') {
      if (def.charAt(0) === '+') {
        defs[name] = parseProj(arguments[1]);
      }
      else {
        defs[name] = wkt(arguments[1]);
      }
    } else {
      defs[name] = def;
    }
  }
  else if (arguments.length === 1) {
    if (Array.isArray(name)) {
      return name.map(function(v) {
        if (Array.isArray(v)) {
          return defs.apply(that, v);
        }
        else {
          return defs(v);
        }
      });
    }
github proj4js / proj4js / lib / parseCode.js View on Github external
function parse(code){
  if (testObj(code)) {
    //check to see if this is a WKT string
    if (testDef(code)) {
      return defs[code];
    }
    if (testWKT(code)) {
      return wkt(code);
    }
    if (testProj(code)) {
      return projStr(code);
    }
  }else{
    return code;
  }
}
github bcgov / smk / smk-parent / smk-client / src / main / webapp / lib / resources / js / lib / parseCode.js View on Github external
function parse(code){
  if (testObj(code)) {
    //check to see if this is a WKT string
    if (testDef(code)) {
      return defs[code];
    }
    if (testWKT(code)) {
      return wkt(code);
    }
    if (testProj(code)) {
      return projStr(code);
    }
  }else{
    return code;
  }
}
github bcgov / smk / smk-parent / smk-client / src / main / webapp / lib / resources / js / lib / defs.js View on Github external
function defs(name) {
  /*global console*/
  var that = this;
  if (arguments.length === 2) {
    var def = arguments[1];
    if (typeof def === 'string') {
      if (def.charAt(0) === '+') {
        defs[name] = parseProj(arguments[1]);
      }
      else {
        defs[name] = wkt(arguments[1]);
      }
    } else {
      defs[name] = def;
    }
  }
  else if (arguments.length === 1) {
    if (Array.isArray(name)) {
      return name.map(function(v) {
        if (Array.isArray(v)) {
          defs.apply(that, v);
        }
        else {
          defs(v);
        }
      });
    }

wkt-parser

wkt-parser ===

MIT
Latest version published 24 days ago

Package Health Score

78 / 100
Full package analysis

Popular wkt-parser functions

Similar packages