You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

2 lines
64 KiB

require=function o(s,a,h){function u(e,t){if(!a[e]){if(!s[e]){var r="function"==typeof require&&require;if(!t&&r)return r(e,!0);if(p)return p(e,!0);var n=new Error("Cannot find module '"+e+"'");throw n.code="MODULE_NOT_FOUND",n}var i=a[e]={exports:{}};s[e][0].call(i.exports,function(t){return u(s[e][1][t]||t)},i,i.exports,o,s,a,h)}return a[e].exports}for(var p="function"==typeof require&&require,t=0;t<h.length;t++)u(h[t]);return u}({1:[function(t,n,e){(function(t){function e(t,e){this.buffer=t,this.position=0,this.isBigEndian=e||!1}function r(e,r,n){return function(){var t;return t=this.isBigEndian?r.call(this.buffer,this.position):e.call(this.buffer,this.position),this.position+=n,t}}(n.exports=e).prototype.readUInt8=r(t.prototype.readUInt8,t.prototype.readUInt8,1),e.prototype.readUInt16=r(t.prototype.readUInt16LE,t.prototype.readUInt16BE,2),e.prototype.readUInt32=r(t.prototype.readUInt32LE,t.prototype.readUInt32BE,4),e.prototype.readInt8=r(t.prototype.readInt8,t.prototype.readInt8,1),e.prototype.readInt16=r(t.prototype.readInt16LE,t.prototype.readInt16BE,2),e.prototype.readInt32=r(t.prototype.readInt32LE,t.prototype.readInt32BE,4),e.prototype.readFloat=r(t.prototype.readFloatLE,t.prototype.readFloatBE,4),e.prototype.readDouble=r(t.prototype.readDoubleLE,t.prototype.readDoubleBE,8),e.prototype.readVarInt=function(){for(var t,e=0,r=0;e+=(127&(t=this.buffer[this.position+r]))<<7*r,r++,128<=t;);return this.position+=r,e}}).call(this,t("buffer").Buffer)},{buffer:"buffer"}],2:[function(t,n,e){(function(r){function t(t,e){this.buffer=new r(t),this.position=0,this.allowResize=e}function e(r,n){return function(t,e){this.ensureSize(n),r.call(this.buffer,t,this.position,e),this.position+=n}}(n.exports=t).prototype.writeUInt8=e(r.prototype.writeUInt8,1),t.prototype.writeUInt16LE=e(r.prototype.writeUInt16LE,2),t.prototype.writeUInt16BE=e(r.prototype.writeUInt16BE,2),t.prototype.writeUInt32LE=e(r.prototype.writeUInt32LE,4),t.prototype.writeUInt32BE=e(r.prototype.writeUInt32BE,4),t.prototype.writeInt8=e(r.prototype.writeInt8,1),t.prototype.writeInt16LE=e(r.prototype.writeInt16LE,2),t.prototype.writeInt16BE=e(r.prototype.writeInt16BE,2),t.prototype.writeInt32LE=e(r.prototype.writeInt32LE,4),t.prototype.writeInt32BE=e(r.prototype.writeInt32BE,4),t.prototype.writeFloatLE=e(r.prototype.writeFloatLE,4),t.prototype.writeFloatBE=e(r.prototype.writeFloatBE,4),t.prototype.writeDoubleLE=e(r.prototype.writeDoubleLE,8),t.prototype.writeDoubleBE=e(r.prototype.writeDoubleBE,8),t.prototype.writeBuffer=function(t){this.ensureSize(t.length),t.copy(this.buffer,this.position,0,t.length),this.position+=t.length},t.prototype.writeVarInt=function(t){for(var e=1;0!=(4294967168&t);)this.writeUInt8(127&t|128),t>>>=7,e++;return this.writeUInt8(127&t),e},t.prototype.ensureSize=function(t){if(this.buffer.length<this.position+t){if(!this.allowResize)throw new RangeError("index out of range");var e=new r(this.position+t);this.buffer.copy(e,0,0,this.buffer.length),this.buffer=e}}}).call(this,t("buffer").Buffer)},{buffer:"buffer"}],3:[function(t,e,r){(function(r){e.exports=i;var u=t("./types"),p=t("./point"),f=t("./linestring"),c=t("./polygon"),l=t("./multipoint"),g=t("./multilinestring"),y=t("./multipolygon"),w=t("./geometrycollection"),d=t("./binaryreader"),n=t("./binarywriter"),a=t("./wktparser"),b=t("./zigzag.js");function i(){this.srid=void 0,this.hasZ=!1,this.hasM=!1}i.parse=function(t,e){if("string"==typeof t||t instanceof a)return i._parseWkt(t);if(r.isBuffer(t)||t instanceof d)return i._parseWkb(t,e);throw new Error("first argument must be a string or Buffer")},i._parseWkt=function(t){var e,r,n=(e=t instanceof a?t:new a(t)).matchRegex([/^SRID=(\d+);/]);n&&(r=parseInt(n[1],10));var i=e.matchType(),o=e.matchDimension(),s={srid:r,hasZ:o.hasZ,hasM:o.hasM};switch(i){case u.wkt.Point:return p._parseWkt(e,s);case u.wkt.LineString:return f._parseWkt(e,s);case u.wkt.Polygon:return c._parseWkt(e,s);case u.wkt.MultiPoint:return l._parseWkt(e,s);case u.wkt.MultiLineString:return g._parseWkt(e,s);case u.wkt.MultiPolygon:return y._parseWkt(e,s);case u.wkt.GeometryColle