src/lib/ogr-cmd.js
function csvParams (cmd, options) {
  cmd.push('-lco', 'WRITE_BOM=YES')
  const hasPointGeom = options.geometry === 'POINT'
  const fields = options.fields.join('|').toLowerCase().split('|')
  const hasXY = fields.indexOf('x') > -1 && fields.indexOf('y') > -1
  if (hasPointGeom && !hasXY) cmd = cmd.concat(['-lco', 'GEOMETRY=AS_XY'])
  return cmd
}
function csvParams (cmd, options) {
  cmd.push('-lco', 'WRITE_BOM=YES')
  const hasPointGeom = options.geometry === 'POINT'
  const fields = options.fields.join('|').toLowerCase().split('|')
  const hasXY = fields.indexOf('x') > -1 && fields.indexOf('y') > -1
  if (hasPointGeom && !hasXY) cmd = cmd.concat(['-lco', 'GEOMETRY=AS_XY'])
  return cmd
}
function csvParams ( cmd , options ) { cmd . push ( '-lco' , 'WRITE_BOM=YES' ) const hasPointGeom = options . geometry === 'POINT' const fields = options . fields . join ( '|' ) . toLowerCase ( ) . split ( '|' ) const hasXY = fields . indexOf ( 'x' ) > - 1 && fields . indexOf ( 'y' ) > - 1 if ( hasPointGeom && ! hasXY ) cmd = cmd . concat ( [ '-lco' , 'GEOMETRY=AS_XY' ] ) return cmd }
Add parameters specific to a csv export

@param {array} cmd - an array of OGR command parts to modify
@param {object} options - may contain fields
@return {array}
@private
Add parameters specific to a csv export