Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
parse(data, options = {}) {
let result;
// If a zip is present, don't read anything else
if (data.zip) {
result = shp.parseZip(data.zip);
} else if (data.shp && data.shx && data.dbf) {
result = Promise.all([
shp.parseShp(data.shp, data.prj),
shp.parseDbf(data.dbf),
]).then(shp.combine);
}
options.crsIn = data.prj ? proj4(data.prj).oProj.datumName : undefined;
return Promise.resolve(result).then(res => GeoJsonParser.parse(res, options));
},
};