well-known-parser
Version:
A WKT/WKB/EWKT/EWKB/TWKB/GeoJSON parser and serializer
3 lines (2 loc) • 1.25 kB
JavaScript
;Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("./well-known-parser7.cjs"),u=require("./well-known-parser4.cjs"),a=require("./well-known-parser16.cjs"),c=require("./well-known-parser11.cjs");function l(n,t){const i=new s.MultiPoint;if(i.srid=t.srid,i.hasZ=t.hasZ??!1,i.hasM=t.hasM??!1,n.isMatch(["EMPTY"]))return i;n.expectGroupStart();const o=n.matchCoordinates(t);for(const e of o)i.points.push(e);return n.expectGroupEnd(),i}function h(n,t){const i=new s.MultiPoint;i.srid=t.srid,i.hasZ=t.hasZ??!1,i.hasM=t.hasM??!1;const o=n.readUInt32();for(let e=0;e<o;e++)i.points.push(c.parseWkb(n,t));return i}function M(n,t){const i=new s.MultiPoint;if(i.hasZ=t.hasZ??!1,i.hasM=t.hasM??!1,t.isEmpty)return i;const o=new u.Point(0,0,t.hasZ?0:void 0,t.hasM?0:void 0),e=n.readVarInt();for(let r=0;r<e;r++)i.points.push(a.parseRelativePointTwkb(n,t,o));return i}function P(n){const t=new s.MultiPoint;n.coordinates.length>0&&(t.hasZ=n.coordinates[0].length>2);for(const i of n.coordinates)t.points.push(a.parsePointGeoJSON(i));return t}exports.parseMultiPointGeoJSON=P;exports.parseMultiPointTwkb=M;exports.parseMultiPointWkb=h;exports.parseMultiPointWkt=l;
//# sourceMappingURL=well-known-parser19.cjs.map